Here is some simple mathematics:

$latex f(x) = \frac{1}{1 + x^2}, $ $latex f'(x) =-\frac{2x}{(1+x^2)^2} $ which can be implemented in a computer code:

def f(x):
    """Runge's function."""
    return 1/(1 + x**2)

# Plot f
import matplotlib.pyplot as plt
import numpy as np
xcoor = np.linspace(-3, 3, 101)
ycoor = f(xcoor)
plt.plot(xcoor, ycoor)
plt.savefig('f_plot.png')

# Compute f'(x) symbolically and make a Python function out of it
import sympy as sm
x = sm.Symbol('x')
f_expr = f(x)
print f_expr
df_expr = sm.diff(f_expr, x)
print df_expr
df = sm.lambdify(x, df_expr)  # turn expression into Python function

# Plot f'(x)
plt.figure()
plt.plot(xcoor, df(xcoor))
plt.savefig('df_plot.png')
plt.show()

A plot of the function $latex f(x)$ appears below.

Here is the derivative $latex f'(x)$ (with figure caption and label, which enables referring to the figure later):


Figure 1: The derivative of Runge's function.

Movies can also be embedded:

The elements above are generated by the following Doconce code.

Here is some simple mathematics:

!bt
\begin{align}
f(x) &= \frac{1}{1 + x^2},
label{eq:f}\\
f'(x) & =-\frac{2x}{(1+x^2)^2}
label{eq:df}
\end{align}
!et
which can be implemented in a computer code:

@@@CODE Runges_func.py

A plot of the function $f(x)$

appears below.

FIGURE: [https://doconce.googlecode.com/hg/doc/blog/f_plot.png, width=400]

Here is the derivative $f'(x)$ (with figure caption and label, which enables
referring to the figure later):

FIGURE: [https://doconce.googlecode.com/hg/doc/blog/df_plot.png, width=400] The derivative of Runge's function. label{fig:Runge:dfdx}

Movies can also be embedded:

MOVIE: [http://www.youtube.com/watch?v=75Ju0eM5T2c]

Notice Notice
 

  1. There must be no title, author, or date in the document.
  2. If the Doconce code above is stored in a file demo.do.txt, run doconce format html demo --wordpress to produce the HTML code, stored in demo.html.
  3. Copy the text in demo.html into the blog text area on http://doconce.wordpress.com site, using Text mode (not Visual!).
  4. Remember to first choose the HTML-code tab (and not just Write) and to place the copied text between the div tags.