<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
           "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
>
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CPT -- In-Page Samples</title>
</head>
<body>
<script type="text/javascript" src="cpt-parser.js"/>
<script type="text/javascript" src="cpt-inpage.js"/>
<h2>Samples Embedding Content Pseudo-TeX in an XHTML Page</h2>
<p>
This page uses many of the same examples seen in the <a href="mathtransdoc.xml">documentation page</a>.
Most examples are given both in-line and displayed style, but some were too large
for reasonable in-line presentation.  The last example shows a more extensive presentation
involving several expressions.
</p>
<hr/>
<p><strong>Example 1:</strong><br/>
CPT source: <kbd>\int[v:x][l:0][u:\pi;]{\sin{x}}=2</kbd><br/>
Inline:
<span class="math"><![CDATA[
\int[v:x][l:0][u:\pi;]{\sin{x}}=2
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
\int[v:x][l:0][u:\pi;]{\sin{x}}=2
]]></div>
<hr/>
<p><strong>Example 2:</strong><br/>
CPT source: <kbd>\limit[v:x][c:{x\tendsto@above|0}]{\sin{x}/x}=1</kbd><br/>
Inline:
<span class="math"><![CDATA[
\limit[v:x][c:{x\tendsto@above|0}]{\sin{x}/x}=1
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
\limit[v:x][c:{x\tendsto@above|0}]{\sin{x}/x}=1
]]></div>
<hr/>
<p><strong>Example 3:</strong><br/>
CPT source: </p>
<pre><![CDATA[\abs{x}=\begin{piecewise}
\begin{piece}
x x>=0
\end{piece}
\begin{otherwise}
-x
\end{otherwise}
\end{piecewise}]]></pre>
<p>Displayed:</p>
<div class="math"><![CDATA[
\abs{x}=\begin{piecewise}
\begin{piece}
x x>=0
\end{piece}
\begin{otherwise}
-x
\end{otherwise}
\end{piecewise}
]]></div>
<hr/>
<p><strong>Example 4:</strong><br/>
CPT source: <kbd>x_1=(-b+\root{b^2-4a*c})/2a</kbd><br/>
Inline:
<span class="math"><![CDATA[
x_1=(-b+\root{b^2-4a*c})/2a
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
x_1=(-b+\root{b^2-4a*c})/2a
]]></div>
<hr/>
<p><strong>Example 5:</strong><br/>
CPT source: <kbd>\sum[v:n][l:1][u:\infinity;]{1/n^2}=\pi;^2/6</kbd><br/>
Inline:
<span class="math"><![CDATA[
\sum[v:n][l:1][u:\infinity;]{1/n^2}=\pi;^2/6
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
\sum[v:n][l:1][u:\infinity;]{1/n^2}=\pi;^2/6
]]></div>
<hr/>
<p><strong>Example 6:</strong><br/>
CPT source: </p>
<pre>\begin{matrix}
\begin{matrixrow}
\cos{&theta;} (-\sin{&theta;})
\end{matrixrow}
\begin{matrixrow}
\sin{&theta;} \cos{&theta;}
\end{matrixrow}
\end{matrix}</pre>
<p>Displayed:</p>
<div class="math"><![CDATA[
\begin{matrix}
\begin{matrixrow}
\cos{&theta;} (-\sin{&theta;})
\end{matrixrow}
\begin{matrixrow}
\sin{&theta;} \cos{&theta;}
\end{matrixrow}
\end{matrix}
]]></div>
<hr/>
<p><strong>Example 7:</strong><br/>
CPT source: </p>
<pre>\int[v:x][l:-\infinity;][u:\infinity;]
     {\exp{-(x^2)}}=\root{\pi;}</pre>
<p>Inline:
<span class="math"><![CDATA[
\int[v:x][l:-\infinity;][u:\infinity;]
     {\exp{-(x^2)}}=\root{\pi;}
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
\int[v:x][l:-\infinity;][u:\infinity;]
     {\exp{-(x^2)}}=\root{\pi;}
]]></div>
<hr/>
<p><strong>Example 8:</strong><br/>
CPT source: </p>
<pre>\diff[v:x]{
      \int[v:t][l:a][u:x]{f(t)}
   }=f(x)</pre>
<p>Inline:
<span class="math"><![CDATA[
\diff[v:x]{
      \int[v:t][l:a][u:x]{f(t)}
   }=f(x)
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
\diff[v:x]{
      \int[v:t][l:a][u:x]{f(t)}
   }=f(x)
]]></div>
<hr/>
<p><strong>Example 9:</strong><br/>
CPT source: </p>
<pre>\begin{apply}
     \partialdiff[s:x y]{f} x y
\end{apply}
     =\partialdiff[v:x][v:y]{f(x,y)}</pre>
<p>Inline:
<span class="math"><![CDATA[
\begin{apply}
     \partialdiff[s:x y]{f} x y
\end{apply}
     =\partialdiff[v:x][v:y]{f(x,y)}
]]></span></p>
<p>Displayed:</p>
<div class="math"><![CDATA[
\begin{apply}
     \partialdiff[s:x y]{f} x y
\end{apply}
     =\partialdiff[v:x][v:y]{f(x,y)}
]]></div>
<hr/>
<p><strong>Example 10:</strong>  Stokes' Theorem (for surface integrals in space)<br/>
<br/>
CPT source: </p>
<pre><![CDATA[\int{\int[c:S][v:&sigma;]{\curl{F}\scalarproduct|N}}
=\int[c:\partialdiff{S}][v:s]{F\scalarproduct|T}]]></pre>
<p>Displayed:</p>
<div class="math"><![CDATA[
\int{\int[c:S][v:&sigma;]{\curl{F}\scalarproduct|N}}
=\int[c:\partialdiff{S}][v:s]{F\scalarproduct|T}
]]></div>
<hr/>
<p><strong>Example 11:</strong> Taylor Polynomials (displayed)<br/>
The first three Taylor polynomial approximations to
<span class="math">f(x)</span>, centered at <span class="math">c</span>, are:</p>
<div class="math"><![CDATA[
f(x)\approx|
f(c)+\begin{apply}\diff{f}c\end{apply}*(x-c)
]]></div>
<div class="math"><![CDATA[
f(x)\approx|
f(c)+\begin{apply}\diff{f}c\end{apply}*(x-c)
+(\begin{apply}\diff[n:2]{f}c\end{apply}/2)*(x-c)
]]></div>
<div class="math"><![CDATA[
f(x)\approx|
f(c)+\begin{apply}\diff{f}c\end{apply}*(x-c)
+(\begin{apply}\diff[n:2]{f}c\end{apply}/2)*(x-c)^2
+(\begin{apply}\diff[n:3]{f}c\end{apply}/6)*(x-c)^3
]]></div>
<p>In general:</p>
<div class="math"><![CDATA[
f(x)\approx|
\sum[v:n][l:0][u:k]{
(\begin{apply}\diff[n:n]{f}c\end{apply}/n!)*(x-c)^n}
]]></div>
<p>where the <span class="math">k</span><sup>th</sup> Taylor remainder,
<span class="math">R_k(x)</span>, is given by:</p>
<div class="math"><![CDATA[
R_k(x)=
f(x)-
\sum[v:n][l:0][u:k]{
(\begin{apply}\diff[n:n]{f}c\end{apply}/n!)*(x-c)^n}
=(\begin{apply}\diff[n:k+1]{f}&xi;\end{apply}/(k+1)!)*(x-c)^(k+1)
]]></div>
<p>for some value of <span class="math"><![CDATA[&xi;]]></span> between
<span class="math">x</span> and <span class="math">c</span>, 
provided <span class="math">\diff[n:k+1]{f}</span> is continuous
between <span class="math">x</span> and <span class="math">c</span>
(which implies that all lower derivatives, including
<span class="math">f</span> itself, are also continuous on that interval).</p>
<hr/>
</body>
</html>


