\documentclass{book} \usepackage{axiom} \usepackage{pstricks} \usepackage{pst-node} \begin{document} \title{Differential Equations DeMystified} \author{Timothy Daly} \maketitle \tableofcontents \vfill \eject \chapter{What is a Differential Equation?} \section{Introductory Remarks} This pamphlet is a series of examples and problems from the book\cite{2} of the same title. We work the examples and problems in the book in order to show ways to use Axiom to attack problems as presented in textbooks. Often problems will arise achieving the exact format shown in the textbook. These format problems occur because Axiom tries to present the solutions in a certain form. The textbook authors clearly have no similar constraint. Manipulations of the form of an equation are done thru coercions of one type to another. Each type has a chosen output form. Occasionally we can coerce the type from the form we have to a form we want which gives us the required answer. For instance, we might like to see ratios of polynomials for the equation \begin{verbatim} eqn:=(1/2)*x+(1/3) \end{verbatim} $$ {{1 \over 2} \ x}+{1 \over 3} \leqno(1) $$ {\hbox{\hskip 5.0cm}} Type: Polynomial Fraction Integer \noindent Notice that the type says that this is a single polynomial which has coefficients which are fractions of integers (rational numbers). But we might want the answer printed as fractions of polynomials with integer coefficients. To do this we coerce the above equation. \begin{verbatim} eqn::Fraction(Polynomial(Integer)) \end{verbatim} $$ {{3 \ x}+2} \over 6 \leqno(7) $$ {\hbox{\hskip 5.0cm}} Type: Fraction Polynomial Integer \noindent Often, however, the desired coercion is not available. Textbooks are quite free with intermediate equation form manipulation and we cannot match that freedom. \section{The Nature of Solutions} \subsection{Example 1.1} We would like to find a function that satisfies the equation $$y^{''} - 5y^{'} + 6y = 0$$ where $y$ is a function of $x$ usually written $y(x)$ First we define a name for the function we plan to find. This will be a function y(x). In Axiom we do this with: <>= y:=operator 'y @ $$ y \leqno(1) $$ {\hbox{\hskip 5.0cm}} Type: BasicOperator \noindent Next we define the differential equation we wish to compute <>= deq := D(y(x), x, 2) - 5*D(y(x), x) + 6* y(x) = 0 @ $$ {{{y \sb {{\ }} \sp {,,}} \left( {x} \right)} -{5 \ {{y \sb {{\ }} \sp {,}} \left( {x} \right)}}+{6 \ {y \left( {x} \right)}}}=0 \leqno(2) $$ {\hbox{\hskip 5.0cm}} Type: Equation Expression Integer \noindent and we ask for the solutions <>= ans:=solve(deq, y, x) @ $$ \left[ {particular=0}, \: {basis={\left[ {e \sp {\left( 3 \ x \right)}}, \: {e \sp {\left( 2 \ x \right)}} \right]}} \right] \leqno(3) $$ {\hbox{\hskip 3.0cm}} Type: Union(Record(particular: Expression Integer,\\ {\hbox{\hskip 5.5cm}} basis: List Expression Integer),...) \noindent We select out the particular solution <>= ans1:=ans.particular @ $$ 0 \leqno(4) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent and check that it is indeed a solution <>= check1:=D(ans1,x,2) - 5*D(ans1,x) + 6*ans1 @ $$ 0 \leqno(5) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent There are two basis elements and we check them both <>= ans2:=ans.basis.1 @ $$ e \sp {\left( 3 \ x \right)} \leqno(6) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer <>= check2:=D(ans2,x,2) - 5*D(ans2,x) + 6*ans2 @ $$ 0 \leqno(7) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer <>= ans3:=ans.basis.2 @ $$ e \sp {\left( 2 \ x \right)} \leqno(8) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer <>= check3:=D(ans3,x,2) - 5*D(ans3,x) + 6*ans3 @ $$ 0 \leqno(9) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent Finally all of the solutions are know to be a linear combination of $e^2$ and $e^3$ and thus are given by $ae^2 + be^3$ for any $a$ and $b$. <>= ans4:=17*ans2+24*ans3 @ $$ {{17} \ {e \sp {\left( 3 \ x \right)}}}+{{24} \ {e \sp {\left( 2 \ x \right)}}} \leqno(10) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer <>= check3:=D(ans4,x,2) - 5*D(ans4,x) + 6*ans4 @ $$ 0 \leqno(11) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer <>= )clear all <> <> <> <> <> <> <> <> <> <> <> @ \subsection{Problem 1.1} \noindent First we declare the function name we use, namely $y(x)$, <>= y:=operator 'y @ $$ y \leqno(1) $$ {\hbox{\hskip 5.0cm}} Type: BasicOperator \noindent In this problem we are asked to find all solutions of the equation $$\frac{d^3y}{dx^3}+\frac{d^2y}{dx^2}-10\frac{dy}{dx}+8y=0$$ <>= deq:=D(y(x),x,3)+D(y(x),x,2)-10*D(y(x),x)+8*y(x) = 0 @ $$ {{{y \sb {{\ }} \sp {,,,}} \left( {x} \right)}+{{y \sb {{\ }} \sp {,,}} \left( {x} \right)} -{{10} \ {{y \sb {{\ }} \sp {,}} \left( {x} \right)}}+{8 \ {y \left( {x} \right)}}}=0 \leqno(2) $$ {\hbox{\hskip 5.0cm}} Type: Equation Expression Integer The solutions are found with: <>= ans:=solve(deq,y,x) @ $$ \left[ {particular=0}, \: {basis={\left[ {e \sp {\left( 2 \ x \right)}}, \: {e \sp x}, \: {e \sp {\left( -{4 \ x} \right)}} \right]}} \right] \leqno(3) $$ {\hbox{\hskip 3.0cm}} Type: Union(Record(particular: Expression Integer, {\hbox{\hskip 5.0cm}} basis: List Expression Integer),...) \noindent We reference the particular solution <>= ans1:=ans.particular @ $$ 0 \leqno(4) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent And substitute it to show it is a solution: <>= check1:=D(ans1,x,3)+D(ans1,x,2)-10*D(ans1,x)+8*ans1 @ $$ 0 \leqno(5) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent There are three basis elements. Each of these represent a solution. We reference the first basis element <>= ans2:=ans.basis.1 @ $$ e \sp {\left( 2 \ x \right)} \leqno(6) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent And substitute it to show it is a solution: <>= check2:=D(ans2,x,3)+D(ans2,x,2)-10*D(ans2,x)+8*ans2 @ $$ 0 \leqno(7) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent We reference the second basis element <>= ans3:=ans.basis.2 @ $$ e \sp x \leqno(8) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent And substitute it to show it is a solution: <>= check3:=D(ans3,x,3)+D(ans3,x,2)-10*D(ans3,x)+8*ans3 @ $$ 0 \leqno(9) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent We reference the second basis element <>= ans4:=ans.basis.3 @ $$ e \sp {\left( -{4 \ x} \right)} \leqno(10) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent And substitute it to show it is a solution: <>= check4:=D(ans4,x,3)+D(ans4,x,2)-10*D(ans4,x)+8*ans4 @ $$ 0 \leqno(11) $$ \noindent In fact, any solution which is a linear combination of the basis elements will be a solution to the problem. That is, the solution is $$ae^{2x} + be^x + ce^{-4x}$$ We choose $a=22$, $b=17$, and $c=30$ to get: <>= ans5:=17*%e^x + 22*%e^(2*x) + 30*%e^(-4*x) @ $$ {{22} \ {e \sp {\left( 2 \ x \right)}}}+{{17} \ {e \sp x}}+{{30} \ {e \sp {\left( -{4 \ x} \right)}}} \leqno(12) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer \noindent And substitute it to show it is a solution: <>= check5:=D(ans5,x,3)+D(ans5,x,2)-10*D(ans5,x)+8*ans5 @ $$ 0 \leqno(13) $$ {\hbox{\hskip 5.0cm}} Type: Expression Integer <>= )clear all <> <> <> <> <> <> <> <> <> <> <> <> <> @ \subsection{Problem 1.2} Axiom can also handle differential equations expressed as an implicitly defined function. The example in the book is $$\frac{dy}{dx} = \frac{y^2}{1-xy}$$ where $y$ is a function of $x$ written $y(x)$ To solve this problem we first define the function to be found <>= y:=operator 'y @ $$ y \leqno(1) $$ {\hbox{\hskip 5.0cm}} Type: BasicOperator \noindent Then we define the differential equation <>= deq:=D(y(x),x) = y(x)^2/(1-x*y(x)) @ $$ {{y \sb {{\ }} \sp {,}} \left( {x} \right)}=-{{{y \left( {x} \right)} \sp 2} \over {{x \ {y \left( {x} \right)}} -1}} \leqno(2) $$ {\hbox{\hskip 5.0cm}} Type: Equation Expression Integer \noindent And ask for the solution <>= solve(deq,y,x) @ $$ -{\log \left( {{y \left( {x} \right)}} \right)}+{x \ {y \left( {x} \right)}} \leqno(3) $$ {\hbox{\hskip 5.0cm}} Type: Union(Expression Integer,...) <>= )clear all <> <> <> @ \subsection{Example 1.2} In this example we are being asked to show that the implicitly definied function $$\frac{dy}{dx} = \frac{y^2}{1-xy}$$ has the solution $$xy = ln(y) + c$$ We define y to be a function <>= y:=operator 'y @ $$ y \leqno(1) $$ {\hbox{\hskip 5.0cm}} Type: BasicOperator \noindent We can prove this by showing that the solution has the correct derivative. We define the solution equation <>= eqn:=x*y(x) = log(y(x))+c @ $$ {x \ {y \left( {x} \right)}}={{\log \left( {{y \left( {x} \right)}} \right)}+c} \leqno(2) $$ {\hbox{\hskip 5.0cm}} Type: Equation Expression Integer \noindent We differentiate the equation <>= deq:=differentiate(eqn,x) @ $$ {{x \ {{y \sb {{\ }} \sp {,}} \left( {x} \right)}}+{y \left( {x} \right)}}={{{y \sb {{\ }} \sp {,}} \left( {x} \right)} \over {y \left( {x} \right)}} \leqno(3) $$ {\hbox{\hskip 5.0cm}} Type: Equation Expression Integer \noindent Solving this for $y(x)$ we get <>= solve(deq,y,x) @ $$ -{\log \left( {{y \left( {x} \right)}} \right)}+{x \ {y \left( {x} \right)}} \leqno(4) $$ {\hbox{\hskip 5.0cm}} Type: Union(Expression Integer,...) \noindent which the book rewrites as $$\frac{dy}{dx}\left[\frac{1}{y}-x\right] = y$$ and then into $$\frac{dy}{dx} = \frac{y^2}{1-xy}$$ <>= )clear all <> <> <> <> @ \subsection{The input file} <<*>>= <> <> <> <> @ \section{Separable Equations} \vfill \eject \begin{thebibliography}{99} \bibitem{1} Jenks, Richard D., Sutor, Robert S., {\sl AXIOM The Scientific Computation System}, Springer-Verlag, NY 1992, ISBN 0-387-97855-0 \bibitem{2} Krantz, Steven G., {\sl differential equations DeMYSTiFieD}, McGraw-Hill 2005, ISBM 0-07-144025-9 \end{thebibliography} \end{document}