Excercise 6

Limits and series

1. Limits

Find the following limits

1.1.	((sin(x))/x),  x -> 0

1.2.	((Sqrt[1 - (x^2)])/(Sqrt[1 - x])), x -> 1

1.3. 	(((1 + (x/n)))^n), n -> ∞

1.4.	\(TraditionalForm\`\(\(2\^\(4  n + 1\)\) \(n!\)\^4\)\/\(\((2  n + 1)\) \(\((2  n)\)!\)\^2\), n -> ∞\)

Solution

(* 1.1 *)  Limit[Sin[x]/x, 
      x -> 0]

     (* 1.2 *)  
    Limit[Sqrt[1 - x^2]/Sqrt[1 - x], x -> 1]

     (* 1.3 *)  
    Limit[(1 + x/n)^n, n -> Infinity]

     (* 1.4 *)  
    Limit[(((2^(4  n + 1)) ((n!)^4))/((2  n + 1) (((2  n)!)^2))), n -> Infinity]

2. Series

2.1. Find the Taylor series of ((sin(x))/x)up to order 5.

2.2. Find the Taylor series of sin(x) up to 2nd, 5th, and 9th orders, and plot each of the together with the sine function to the same figure.

2.3. Add together the squares of the series expansions of sine and cosine. Compare what you should get to what you did get!

2.4. Expand an undefined function, say f(x), as a power series. What do you find?

2.5. As an example of a Laurent series, expand the function f(x) = tan(x) as series around the point (Subscript[x, 0]) = π/2. Compare the result to the fraction of the power series of sin(x) and cos(x) expanded around the same point. 

2.6. Functions can have Laurent series expressions around the point (Subscript[x, 0]) = ∞ also. As an example, find the Laurent series of the function (((Subscript[J, 0])(x))^2) around the point (Subscript[x, 0]) = ∞up to second order. (Subscript[J, 0])(x) is the zeroth order Bessel J function, given in Mathematica by the BesselJ[0,x] function. Plot the series and the original function in same figure.

2.7. Show that the relativistic expression for energy, E = m (c^2), reduces to the non-relativistic kinetic energy, E = (Subscript[m, 0]) (c^2) + (1/2) m (v^2), when we take the relationship between the mass m of a moving body and rest mass (Subscript[m, 0]) to be m = ((Subscript[m, 0])/(Sqrt[1 - ((v^2)/(c^2))])), as given by the theory of relativity.

Solution

Series[
      Sin[x]/x, {x, 0, 5}]

  

    f = Sin;

    sinser = 
        Table[Normal[Series[f[x], {x, 0, i}]], {i, 1, 31, 
            2}];

    Plot[Evaluate[sinser], {x, -3 π, 3  π}, 
      PlotStyle -> 
        Table[Hue[i/Length[sinser]], {i, 
            Length[sinser]}]]

  

    Series[Sin[x], {x, x0, 3}]^2 + 
      Series[Cos[x], {x, x0, 3}]^2

  

    Clear[f]

    Series[f[x], {x, 0, 5}]

  

    Series[Tan[t], {t, Pi/2, 4}]

    Series[Sin[t], {t, Pi/2, 4}]/
      Series[Cos[t], {t, Pi/2, 4}]

  

    Series[BesselJ[0, x]^2, {x, Infinity, 4}]
  

  

    Series[((m0 (c^2))/(Sqrt[1 - ((v^2)/(c^2))])), {v, 0, 2}] // 
      Normal

Differential equations

Solve the following linear first order differential equations

3.1.	y' (x) + 3  y(x) = 2,  y(0) = 1

3.2.	x' (t) + sin(t) x(t) = 0,  
      x(0) = -1. Also plot the solution x(t) for 0 < t < 3

3.3.	f' (x) + p(x) f(x) = q(x), find the general solution.

Solve the following second-order linear differential equations

3.4.	y'' (t) + 3  y' (t) - 2  y(t) = 1,  
      y' (0) = 1,  y(0) = 0, plot the real part of the solution.

3.5.	f'' (x) + x f(x) = 0,  f' (0) = 1,  
      f(0) = 2, solve both numerically and analytically. 

3.6.	x'' (t) + (a - 2  q cos(2  t)) x(
              t) = 0. 

Solve the following nonlinear differential equations. If DSolve does not give you an analytic solution, find the solution numerically.

3.7.	y' (t) + ((y(t))^2) = 0,  y(0) = 2, plot the solutions for 0 < t < 10

3.8.	θ'' (t) + (1/10) θ' (t) + 
          2  sin(θ(t)) = 3  cos(2  t), plot the solution for 0 < t < 10  π

3.9. Additional extra-fun excercise! Solve the following nonlinear set of differential equations (known as the Lorenz equations):

	x' (t) = σ (y(t) - x(t))
y' (t) = ρ x(t) - 
          y(t) - x(t) z(t)
z' (t) = x(t) y(t) - β z(
              t)		σ = 10.0
ρ = 28.0
β = 2.6667

You can try to plot the solution as a three dimensional curve using ParametricPlot3D.

Solution

Clear[y, x, f, t, p, q]

  
DSolve[{y'[x] + y[x] == 2, y[0] == 1}, y[x], 
      x]

  
DSolve[{x'[t] + Sin[t] x[t] == 0, x[0] == -1}, 
      x[t], t]
Plot[x[t] /. %, {t, 0, 3}]

  
DSolve[f'[x] + p[x] f[x] == q[x], f[x], 
      x]
 (* 
      Mathematica needs to write integrals of some dummy variables in the solutions .  For those variables,  
      it automatically generates new names .  
          Those are the K$nnn symbols appearing in the solutions .  
          They' re just some variables,  
      don' t worry about them *) 

 (* 3.4 *) 
DSolve[{y''[t] + 3  y'[t] - 2  y[t] == 
          1, y'[0] == 1, y[0] == 0}, y[t], 
      t]
Plot[y[t] /. %, {t, 0, 3}]

  
  
DSolve[{f''[x] + x f[x] == 0, f'[0] == 1, 
        f[0] == 2}, f[x], x]
NDSolve[{f''[x] + x f[x] == 0, f'[0] == 1, 
        f[0] == 2}, f[x], {x, 0, 10}]
Plot[{f[x] /. %%, f[x] /. %}, {x, 0, 
        10}]

  
  
DSolve[x''[t] + (a - 2  q Cos[2  t]) x[t] == 0, x[t], 
      t]

 (* 
      The following problems involve nonlinear equations *) 
 (* 3.7 *)  
DSolve[{y'[t] + y[t]^2 == 0, y[0] == 2}, y[t], 
      t]
Plot[y[t] /. %, {t, 0, 10}]

  
  
NDSolve[{q''[t] + 0.1 q'[t] + 2 Sin[q[t]] == 
          3 Cos[2  t], q[0] == 1, q'[0] == 0}, 
      q[t], {t, 0, 30  π}]
Plot[
      q[t] /. %, {t, 0, 30  π}]

  
  
Clear[sigma, x, y, z, rho, beta]
Eqs = {
x'[t] == 
            sigma (y[t] - x[t]), y'[t] == 
            rho x[t] - y[t] - x[t] z[t], z'[t] == 
            x[t] y[t] - beta z[t], 
x[0] == -1, 
          y[0] == -4, z[0] == -2} /. {sigma -> 10.0, 
          rho -> 28.0, beta -> 8. /3. }
lsol = 
      NDSolve[Eqs, {x[t], y[t], z[t]}, {t, 0, 100}, 
        MaxSteps -> ∞]
ParametricPlot3D[Evaluate[{x[t], y[t], z[t]} /. lsol], {t, 0, 100}, 
      PlotRange -> All, PlotPoints -> 10000]