1. Getting Started

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

\(Clear["Global`*`"]; 
Off[General::spell]; 
Off[General::spell1]; 
    \)

1.5 Calculus

1.5.1  Integration

eq1  =  Integrate[a x/(b - c x^3), x]  //  Simplify

D[eq1, x]

D[eq1, x]  //  Simplify

1.5.2  Analytic Solutions of Differential Equations

eq1  =  y''[t]  +  w0^2 y[t]  ==  0;

initial  =  {y[0] == yo,  y'[0] == v0};

eq2  =  Append[initial, eq1]

eq3  =  DSolve[eq2, y[t], t]  // Flatten  // ExpandAll

Version Note:  Mathematica 3.0 has Algebra`Trigonometry` already loaded and gives the solution without complex exponentials.

1.5.3  Changing Variables and Pure Functions

eq1  =  
      a x[t]  +  b x'[t]  +  c x''[t]  ==  0;

eq1  //.  {x[t]  ->  y[t] + 2}

Note:  Substitution was not applied to the derivatives.

eq1  /.  {x -> ((y[#] + 2 )&)}

eq1  /.  {x -> ((y[#] + 2 )&)}  // ExpandAll

dsol  =  DSolve[x[t] == y[t] + 2, {x}, t] [[1]]

1.5.4  Numerical Solutions of Differential Equations

\(\(eq1\  = 
      \ {\(\(x'\)'\)[t]\  == \ \(-x[t]\)\  - \ x[t] y[t]^2\ , 

        		\ \ \ \ \ \ \ \ \ \ \ 
        \(\(y'\)'\)[t]\  == \ \(-y[t]\)\  - \ x[t] y[t]^2\ }\ ; \)\)

\(\(initial\  = 
      \ {x[0]\  == \ 2, \ \(x'\)[0]\  == \ 0, 

        		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ y[0]\  == \ 1, \ 
        \(y'\)[0]\  == \ 0\ }; \)\)

ndsol  =  
      NDSolve[Join[eq1, initial], {x, y}, {t, 0, 20}][[1]]

\(\(Plot[Evaluate[{x[t], y[t]} /. ndsol]

      \ \ \ \ \ \ \ \ \ \ , {t, 0, 20}
\ \ \ \ \ \ \ \ \ \ , \ 
      PlotStyle\  -> {\ {Dashing[{\ \ \ \ \ \ \ }]}

          	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ , {Dashing[{ .05}]}\ \ }
	]; \)\)

ParametricPlot[Evaluate[{x[t], y[t]} /. ndsol], {t, 0, 20}];