Skip to main content

Section 1.5 Using Sage to solve equations

Solve the equation \(x^{2}+3x-a=0.\) Pay attention to the inputs.
Here is an very important question for linear algebra.
Find the all values of \(x,y,z\) which satisfy the equations below.
\begin{align*} 3y+4z\amp=11\\ 3x-7y+4z\amp=4\\ 3x-9y+6z\amp= 6 \end{align*}
You should learn from the following example because I will ask you questions to answer.

Subsection 1.5.1 Math Features

Text with some math: \(\sin(x) = \cos(x)\) only for some values of \(x\text{.}\)
Math is rendered using MathJax on the web (and just plain latex when building a PDF) and can accept arbitrarily complex \(\LaTeX\) expressions. Here’s a gnarly one:
\begin{align*} \left\langle x^{\prime}, t^{\prime} \mid x_{0}, t_{0}\right\rangle \amp;= \lim\limits_{N \rightarrow \infty} \int d x_{1} \cdots \int d x_{N-1} \int \frac{d p_{1}}{2 \pi \hbar} \ldots\\ \amp; \times \int \frac{d p_{N}}{2 \pi \hbar} \exp \left\{\frac{i}{\hbar} \sum_{i=1}^{N}\left[p_{i} \frac{\left(x_{i}-x_{i-1}\right)}{\Delta t}-E\left(p_{i}, x_{i-1}\right)\right] \Delta t\right\} \end{align*}
You can refer to other things, for example, a previous proof with xref and it will include an expandable “knowl” of the content for reference! Let’s refer to
And no math book would be complete without some theorem-like statement.

Proof.

There isn’t enough room in this code block for my clever proof.
Want to have two things side-by-side? We can do it with a sidebyside element:
def fib(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fib(n-1) + fib(n-2)
Here’s a sample python implementation for finding the \(n\)th Fibonancci number recursively. That actually reminds me... We can run it interactively using the sage code blocks. We’ll do that in