This second post was entirely written as an IPython notebook. It tests some of the many awesome things IPython can do.

Code samples from [here](http://nbviewer.ipython.org/github/ipython/ipython/tree/2.x/examples/Notebook/)


## The Lorenz Equations

\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{align}

## The Cauchy-Schwarz Inequality

\begin{equation*}
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
\end{equation*}

## The probability of getting \(k\) heads when flipping \(n\) coins is

\begin{equation*}
P(E)   = {n \choose k} p^k (1-p)^{ n-k} 
\end{equation*}

# Inline Typesetting (Mixing Markdown and TeX)

---

While display equations look good for a page of samples, the ability to mix math and *formatted* **text** in a paragraph is also important.

This expression $\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a **[Markdown-formatted](http://daringfireball.net/projects/markdown/)** sentence.  


```
from IPython.display import YouTubeVideo, Image
# a talk about IPython at Sage Days at U. Washington, Seattle.
# Video credit: William Stein.
YouTubeVideo('1j_HxD4iLn8')
```











```
Image(url='http://python.org/images/python-logo.gif')
```









```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
```


```
def f(x):
    return (x-3)*(x-5)*(x-7)+85

x = np.linspace(0, 10, 200)
y = f(x)
```

Choose a region to integrate over and take only a few points in that region


```
a, b = 1, 9
xint = x[np.logical_and(x>=a, x<=b)][::30]
yint = y[np.logical_and(x>=a, x<=b)][::30]
```

Plot both the function and the area below it in the trapezoid approximation


```
plt.plot(x, y, lw=2)
plt.axis([0, 10, 0, 140])
plt.fill_between(xint, 0, yint, facecolor='gray', alpha=0.4)
plt.text(0.5 * (a + b), 30,r"$\int_a^b f(x)dx$", horizontalalignment='center', fontsize=20);
```

2b8484ed3331a10fb0585cc138d2e431252b170a
ipynb
Jupyter Notebook
posts/post2.ipynb
j-faria/me-in-the-web
7e8e88f28a98ae40e31bdd76e50672a3a9939a94
CC-BY-3.0
posts/post2.ipynb
j-faria/me-in-the-web
7e8e88f28a98ae40e31bdd76e50672a3a9939a94
CC-BY-3.0
posts/post2.ipynb
j-faria/me-in-the-web
7e8e88f28a98ae40e31bdd76e50672a3a9939a94
CC-BY-3.0
Qwen/Qwen-72B
1. YES
2. YES