$Id: sin_cos_forward.omh 3757 2015-11-30 12:03:07Z bradbell $
// BEGIN SHORT COPYRIGHT
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell

CppAD is distributed under multiple licenses. This distribution is under
the terms of the
                    GNU General Public License Version 3.

A copy of this license is included in the COPYING file of this distribution.
Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
-------------------------------------------------------------------------- */
// END SHORT COPYRIGHT

$begin sin_cos_forward$$
$spell
	sin
	cos
	sinh
	cosh
	Taylor
$$


$section Trigonometric and Hyperbolic Sine and Cosine Forward Theory$$
$mindex sin sinh cos cosh$$

$head Differential Equation$$
The
$cref/standard math function differential equation
	/ForwardTheory
	/Standard Math Functions
	/Differential Equation
/$$
is
$latex \[
	B(u) * F^{(1)} (u) - A(u) * F (u)  = D(u)
\] $$
In this sections we consider forward mode for the following choices:

$table
$pre	$$
	$cnext $cnext $latex F(u)$$
	$cnext $cnext $latex \sin(u)$$
	$cnext $cnext $latex \cos(u)$$
	$cnext $cnext $latex \sinh(u)$$
	$cnext $cnext $latex \cosh(u)$$
$rnext
	$cnext $cnext $latex A(u)$$
	$cnext $cnext $latex 0$$
	$cnext $cnext $latex 0$$
	$cnext $cnext $latex 0$$
	$cnext $cnext $latex 0$$
$rnext
	$cnext $cnext $latex B(u)$$
	$cnext $cnext $latex 1$$
	$cnext $cnext $latex 1$$
	$cnext $cnext $latex 1$$
	$cnext $cnext $latex 1$$
$rnext
	$cnext $cnext $latex D(u)$$
	$cnext $cnext $latex \cos(u)$$
	$cnext $cnext $latex - \sin(u)$$
	$cnext $cnext $latex \cosh(u)$$
	$cnext $cnext $latex \sinh(u)$$
$tend

We use $latex a$$, $latex b$$, $latex d$$ and $latex f$$ for the
Taylor coefficients of
$latex A [ X (t) ]$$,
$latex B [ X (t) ]$$,
$latex D [ X (t) ] $$,
and $latex F [ X(t) ] $$ respectively.
It now follows from the general
$xref/
	ForwardTheory/
	Standard Math Functions/
	Taylor Coefficients Recursion Formula/
	Taylor coefficients recursion formula/
	1
/$$
that for $latex j = 0 , 1, \ldots$$,
$latex \[
\begin{array}{rcl}
f^{(0)} & = & D ( x^{(0)} )
\\
e^{(j)}
& = & d^{(j)} + \sum_{k=0}^{j} a^{(j-k)} * f^{(k)}
\\
& = & d^{(j)}
\\
f^{(j+1)} & = & \frac{1}{j+1} \frac{1}{ b^{(0)} }
\left(
	\sum_{k=1}^{j+1} k x^{(k)} e^{(j+1-k)}
	- \sum_{k=1}^j k f^{(k)}  b^{(j+1-k)}
\right)
\\
& = & \frac{1}{j+1}
	\sum_{k=1}^{j+1} k x^{(k)} d^{(j+1-k)}
\end{array}
\] $$
The formula above generates the
order $latex j+1$$ coefficient of $latex F[ X(t) ]$$ from the
lower order coefficients for $latex X(t)$$ and $latex D[ X(t) ]$$.

$end
