Hyperbolic Sine & Cosine

Cosh[x] = 
      1 + ((x^2)/2) + ⋯ + ((x^(2 n))/((2 n)!)) + 
        ⋯Sinh[x] = 
      x + ((x^3)/6) + ⋯ + 
        ((x^(2 n + 1))/((2 n + 1)!)) + ⋯

by
K. D.  Stroyan
University of Iowa

copyright 1997 by Academic Press, Inc. - All rights reserved.

Special Mathematica Functions used in this NoteBook

Off[General::spell1];
Needs["Graphics`Colors`"]
seriesGraphs[f_, series_, radius_, numterms_Integer, opns___Rule] :=
	Module[ {functions, graylevels, i, j,n,x,terms},
	Do[
	functions = Table[series[x,n], {n, 0, i}] ;
	AppendTo[functions, f[x]] ;
	graylevels = Table[{GrayLevel[j]}, {j, 6/10, 0, -6/(10 i)}] ; 
	graylevels=AppendTo[graylevels,{AbsoluteThickness[2],Red}];
	Plot[Release[functions], {x, -radius, radius},
		PlotStyle -> graylevels,PlotLabel ->i"terms",
		opns,AspectRatio->Automatic];
	,{i, 1, numterms}];
	Do[
	Plot[Release[{f[x], series[x,n]}],{x, -radius, radius},
		PlotLabel ->n"terms ", opns,
		PlotStyle -> {{AbsoluteThickness[2],Red},{GrayLevel[0]}},
		AspectRatio->Automatic];
	,{n, 1, numterms}];
	];

Needs["Graphics`Colors`"]
powerGraphs[f_,  radius_, numterms_, opns___Rule] :=
	Module[ {functions, graylevels, i, j,n,x,terms},
	Do[
	functions = Table[Normal[Series[f[x],{x,0,n}]], {n, 0, i}] ;
	AppendTo[functions, f[x]] ;
	graylevels = Table[{GrayLevel[j]}, {j, 6/10, 0, -6/(10 i)}] ; 
	graylevels=AppendTo[graylevels,{AbsoluteThickness[2],Red}];
	Plot[Release[functions], {x, -radius, radius},
		PlotStyle -> graylevels, PlotLabel ->i"terms",
		opns,AspectRatio->Automatic];
	,{i, 1, numterms}];
	Do[
	Plot[Release[{Normal[Series[f[x],{x,0,n}]],f[x]}],{x, -radius, radius},
		PlotLabel ->n"terms ", opns, 
		PlotStyle -> {{GrayLevel[0]},{AbsoluteThickness[2],Red}},AspectRatio->Automatic];
	,{n, 1, numterms}];
	];
On[General::spell1];

Notebook Overview

This NoteBook studies the hyperbolic sine and cosine.  These functions can be thought of several ways.  The first is as unique solutions to certain initial value problems.  The second is as series expansions.  Uniqueness of solution of the IVP means that any way we find a solution to the IVP must actually be an expression for the same function.  This lets us show that the following are the same

Cosh[x] = 
      1 + ((x^2)/2) + ⋯ + ((x^(2 n))/((2 n)!)) + 
        ⋯Sinh[x] = 
      x + ((x^3)/6) + ⋯ + 
        ((x^(2 n + 1))/((2 n + 1)!)) + ⋯

References to the Text

This NoteBook goes with Exercise 26.4.2 of the text.

A First Look

Mathematica can find power series expansions of most functions.

Mathematica's Series[.] function

<Enter> the next computation to see Mathematica's description of the Series[.] function.

?? Series

Cosh[x]

Clear[f, x]; f[x_] := Cosh[x]; n = 10; Print[Series[f[x], {x, 0, n}]];

The Series Graphs

The powerGraphs[.] function defined above in the Initialization cell uses the built-in Series[.] function to plot a function and its power series approximations within the "radius" you specify and up to the number of terms "n" you specify.  (The graphs only converge inside the "radius of convergence" studied in Chapter 26.)

radius = 5; powerGraphs[f, radius, n, AspectRatio -> 1, 
      PlotRange -> {0, 3 radius}];

Practice Exercise

Use Mathematica to find the power series expansion of Sinh[x] and plot the first 20 terms.

Exercise 26.4.2: The Differential Equations and Series

(0) Uniqueness

Solutions to initial value problems are unique provided the growth law is smooth.  Look up the exact statement of the Existence & Uniqueness Theorem from Chapter 22 and show that the problem

y[0] == y0,
	z[0] == z0,
	y'[x] == z[x],
	z'[x] ==  y[x]

satisfies the theorem.  (HINT: What are the functions  f[y,z] and g[y,z]  in the formulas  dy/dx = f[x,y,z] and g[x,y,z]?  Where are they smooth?)

(1c) Cosh Analytical Solution

Show that  y[x] =( Exp[x] + Exp[-x])/2 is a solution to the initial value problem:

Clear[x, y, z]; DSolve[{
		y[0] == 1,
		z[0] == 0,
		y'[x]==z[x],
		z'[x]==y[x]
		},{y[x], z[x]},x]

The unique solution to this problem also goes by the name "hyperbolic cosine" or Cosh[x].  By definition, Cosh[x] is THE solution, so this is one proof that

		Cosh[x] = (Exp[ x ] + Exp[-x ])/2

(1s) Sinh Analytical Solution

Show that  y[x] =( Exp[x] - Exp[-x])/2 is a solution to the initial value problem:

Clear[x, y, z];
DSolve[{
	\(y[0]\  == \ 0, 
	z[0]\  == \ 1, 
	
                \(y'\)[x]\  == \ z[x], 
	\(z'\)[x]\  == \ \ y[x]\)
},{y[x], z[x]},x]

The unique solution to this problem also goes by the name "hyperbolic sine" or Sinh[x].  By definition, Sinh[x] is THE solution, so this is one proof that

			Sinh[x] = (Exp[ x ] - Exp[-x ])/2

(2c) Cosh Series Solution

Solve

y[0] == 1,
	z[0] == 0,
	y'[x] == z[x],
	z'[x] ==  y[x]

by substituting the unknown series
	
	y[x] = a[0] + a[1] x + a[2] (x^2) + ...+ a[n] (x^n) + ...
	
	y'[x] = a[1] + 2 a[2] x + 3 a[3] (x^2) + ...+ (n+1) a[n+1] (x^n) + ...
	
	y''[x] = 2 a[2] + 3*2 a[3] x + ... + (n+2)(n+1) a[n+2] (x^n) + ...

into the initial conditions and differential equation.  Here's a start:

INITIAL CONDITIONS:
	y[0] = a[0] = 1
	
	y'[0] = a[1] = 0

THE EQUATION: 
	y''[x] = y[x]
		
2 a[2] + 3*2 a[3] x + 4*3*a[4] (x^2) +  ... + (n+2)(n+1) a[n+2] (x^n) + ...
=
1        +        0 x      +     a[2] (x^2)       + ...+ a[n] (x^n) + ...,

so a[2] = 1/2, a[3] = 0, 4*3 a[4] = a[2] => a[4] = 1/(4*3*2) = 1/4!, ...

aODD = a[2n+1] = 0
aEVEN = a[2 n] = 1/(2n)!
	
	solutionC[x] = 1 + (x^2)/2 +(x^4)/4! + (x^6)/6! + (x^(2  n))/((2n)!) + ...

YOUR EXPLANATION OF THE SOLUTION OF THE a[n]'s:

(2s) Sinh Series Solution

Solve
	y[0] == 0,
	z[0] == 1,
	y'[x] == z[x],
	z'[x] ==  y[x]
	by substituting the unknown series
	y[x] = a0 + a1 x + a2 (x^2) + ...+ an (x^n) + ...

INITIAL CONDITIONS:
	y[0] = a[0] = 0
	
	y'[0] = a[1] = 1

THE EQUATION: 
	y''[x] = y[x]
	⋮
	solutionS[x] = x + (x^3)/3! + (x^5)/5! + ... + (x^(2  n + 1))/((2n+1)!) + ...

YOUR SOLUTION OF THE a[n]'s:

(2A) Automatic Series Solutions

Check your work with this:

n = 20; series = (∑_(k = 0)^n) a[k] (x^k) + O[x]^nD[series,  x]D[series,  {x,  2}]

a[0]  =  1;  a[1]  =  0;  seriesSolve[D[series,  {x,  2}]  ==  series]

a[0]  =  0;  a[1]  =  1;  seriesSolve[D[series,  {x,  2}]  ==  series]

(3) Convergence

Use the ratio test to show that the series

solutionC[x] = 1 + ((x^2)/2) + ⋯ + ((x^(2 n))/((2 n)!)) + 
        ⋯

and

solutionS[x] = x + ((x^3)/6) + ⋯ + 
        ((x^(2 n + 1))/((2 n + 1)!)) + ⋯

both converge uniformly for  | x | <= r, for any  r > 0. (The radius of convergence is +Infinity.)

(4) Identities Like Euler's via Series

We know

Exp[x] = 
        1 + x + ((x^2)/2) + ⋯ + ((x^n)/(n!)) + 
          ⋯
and
	Exp[-x] = 
        1 - x + ((x^2)/2) + ⋯ + 
          (((((-1))^n) (x^n))/(n!)) + ⋯

Combine these series to prove that the series solutions match the combinations:

solutionC[x] = (Exp[x] + Exp[-x])/2
and
	solutionS[x] = (Exp[x] - Exp[-x])/2

(5) Substitution

Prove that

Cosh[ I x ] = Cos[ x ]

and

Sinh[ I x ]/I = Sin[ x ]

(where  I = Sqrt[ -1 ].)  Use either series or differential equations to prove this.

(6) Differentiate

D[Cosh[x], x]

D[Sinh[x], x]

(7) Identities

Find an addition formula for Cosh[x+y].  Here are some ideas:

Simplify[Cosh[x]^2 - Sinh[x]^2]Simplify[Cosh[x] Sinh[y] + Sinh[x] Cosh[y]]

(8) First Order Equations

Solve

y[0] == 1,
y'[x] == (Sqrt[y[x]^2 - 1])

and

y[0] == 0,
y'[x] == (Sqrt[y[x]^2 + 1])

Mathematica has some trouble with this problem.  Explain the following attempts:

Clear[x, y]; DSolve[{y[x] == 0,y'[x]==(Sqrt[y[x]^2 + 1])},{y[x]},x]

∫(1/(Sqrt[(y^2) + 1])) \[DifferentialD]y∫1 \[DifferentialD]xSolve[∫(1/(Sqrt[(y^2) + 1])) \[DifferentialD]y == x, y]

∫(1/(Sqrt[(y^2) - 1])) \[DifferentialD]y∫1 \[DifferentialD]xSolve[∫(1/(Sqrt[(y^2) - 1])) \[DifferentialD]y == x, y]

y[x_] := Cosh[x]; (∂_x) y[x]Simplify[(Sqrt[y[x]^2 - 1])]

Mathematica works with complex functions, so the square root has two values.  In other words, the GENERAL algorithms do NOT simplify (Sqrt[Sinh])[x]^2 to Sinh[x].  For example, check TRUTH of the following equations:

(Sqrt[(x^2)]) == x

(x^2) == (x^2)

(9) Uniqueness?

Do these last two first order initial value problems satisfy the hypotheses of the existence and uniqueness theorem?