MATH528Due date: 08/29/18

Homework 01 Solution

Follow this model when solving your homework.

8 exercises x .25 = 2 points, 4 problems x .5 = 2 points, 1 project x 1 points = 1 point

1Exercises

Exercise 1. PS1.1.4

Solution. y'=-1.5y is: 1st-order, explicit, linear, separable ODE

dydx=-1.5y⇒dyy=-1.5⁡dx⇒∫dyy=-1.5∫⁡dx+lnA⇒ln⁡y=-1.5x+ln⁡A⇒y(x)=A⁡e-1.5x

In[19]:=

ODE = y'[x]==1.5y[x]

y'(x)=1.5⁢y(x)

In[20]:=

DSolve[ODE,y[x],x]

{{y(x)→c1⁢e1.5⁢x}}

In[21]:=

Exercise 2. PS1.1.6

Solution. y''=-y is: 2nd-order, explicit, linear, solve by finding roots of characteristic equation r2+1=0

r1,2=±i⇒y(x)=a⁡ei⁡x+b⁡e-i⁡x=A⁡sin(x)+B⁡cos(x)

In[21]:=

ODE = y”[x]==-y[x]

y''(x)=-y(x)

In[22]:=

DSolve[ODE,y[x],x]

{{y(x)→c2⁢sin⁡(x)+c1⁢cos⁡(x)}}

In[23]:=

Exercise 3. PS1.1.7

Solution. y'=cosh⁡(5.13x) is: 1st-order, explicit, linear, separable ODE

In[23]:=

ODE = y'[x]==Cosh[5.13x]

y'(x)=cosh⁡(5.13⁢x)

In[24]:=

DSolve[ODE,y[x],x]

{{y(x)→c1+0.194932⁢sinh⁡(5.13⁢x)}}

In[25]:=

Exercise 4. PS1.1.8

Solution. y'''=e-0.2x is: 3rd-order, explicit, linear, separable ODE

In[25]:=

ODE = y”'[x]==Exp[-0.2x]

y(3)(x)=e-0.2⁢x

In[26]:=

DSolve[ODE,y[x],x]

{{y(x)→c3⁢x2+c2⁢x+c1-125.⁢e-0.2⁢x}}

In[27]:=

Exercise 5. PS1.3.3

Solution. y'=sec2y is: 1st-order, explicit, non-linear, separable ODE

dysec2y=cos2y⁡dy=dx⇒∫cos2y⁡dy=x+c

From trigonometric identity cos(2y)=cos2y-sin2y=2⁡cos2y-1⇒cos2y=12(cos(2y)+1), so

∫cos2y⁡dy=14sin(2y)+y2=x+c.

In[63]:=

ODE = y'[x]==Sec[y[x]]^2

y'(x)=sec2(y(x))

In[64]:=

DSolve[ODE,y[x],x]

{{y(x)→InverseFunction[2⁢(#12+14⁢sin⁡(2#1))⁢&]⁢[c1+2⁢x]}}..

In[65]:=

Integrate[Cos[y]^2,y]

y2+14⁢sin⁡(2⁢y)

In[66]:=

Exercise 6. PS1.3.4

Solution. y'sin⁡2πx=π⁡y⁡cos⁡2π⁡x is: 1st-order, explicit, non-linear, separable ODE

y'y=πcos⁡2πxsin⁡2πx=π⁡cot⁡2πx⇒dyy=π⁡cot⁡2πx⁡dx=12⁡d(log(sin⁡2π⁡x))⇒log⁡y=12log(sin⁡2πx)+log⁡c⇒
y(x)=csin⁡2⁡π⁡x.

In[67]:=

ODE = y'[x]==Pi y[x] Cos[2Pi x]/Sin[2 Pi x]

y'(x)=π⁢y(x)⁢cot⁡(2⁢π⁢x)

In[68]:=

DSolve[ODE,y[x],x]

{{y(x)→c1⁢sin⁡(2⁢π⁢x)}}

Exercise 7. PS1.3.5

Solution. y⁡y'+36x=0 is: 1st-order, explicit, non-linear, separable ODE

12d⁡y2=-36⁡x⁡dx⇒y22=-18x2+c

In[69]:=

ODE = y[x] y'[x]+36 x ==0

y(x)⁢y'(x)+36⁢x=0

In[70]:=

DSolve[ODE,y[x],x]

{{y(x)→-2⁢c1-18⁢x2},{y(x)→2⁢c1-18⁢x2}}

In[71]:=

Exercise 8. PS1.3.5

Solution. y⁡y'+36x=0 is: 1st-order, explicit, non-linear, separable ODE

12d⁡y2=-36⁡x⁡dx⇒y22=-18x2+c

In[69]:=

ODE = y[x] y'[x]+36 x ==0

y(x)⁢y'(x)+36⁢x=0

In[70]:=

DSolve[ODE,y[x],x]

{{y(x)→-2⁢c1-18⁢x2},{y(x)→2⁢c1-18⁢x2}}

In[71]:=

2Problems

Problem 1. PS1.2.2

Solution. F(x,y,y')=y⁡y'+4⁡x=0, is 1st-order, non-linear, separable, trivially implicit since F=0 can easily be solved to find y'=f(x,y)=-4x/y. Note that f(x,y) is not Lipschitz continuous, hence existence of a unique solution is not guaranteed.

In[15]:=

f[x_,y_]=-4x/y

-4⁢xy

In[16]:=

ODE = y'[x]==f[x,y[x]]

y'(x)=-4⁢xy(x)

In[17]:=

DSolve[ODE,y[x],x]

{{y(x)→-2⁢c1-2⁢x2},{y(x)→2⁢c1-2⁢x2}}

In[18]:=

From Slide8Lesson01

In[18]:=

Off[DSolve::bvnul];

sol1[x_] = y[x] /. DSolve[{ODE,y[1]==1},y[x],x][[1,1]];

sol2[x_] = y[x] /. DSolve[{ODE,y[0]==2},y[x],x][[1,1]];

{sol1[x],sol2[x]}

{5-4⁢x2,2⁢1-x2}

In[19]:=

From Slide8Lesson01:

In[20]:=

DirectionField = VectorPlot[{1,f[x,y]},{x,0,1.25},{y,0,2.5},Axes->True,Frame->False,ImageSize->Large,VectorScale->.3,VectorMarkers->None];

SolutionPlot = Plot[{sol1[x],sol2[x]},{x,0,1.25},ImageSize->Large];

plots=Show[{SolutionPlot,DirectionField}];

Export["/home/student/courses/MATH528/HW01Fig01.pdf",plots]

/home/student/courses/MATH528/HW01Fig01.pdf

In[21]:=

Figure 1. PS1.2.2 direction field and solutions passing through (1,1),(0,2)

Problem 2. PS1.2.3

Solution. y'=f(y)=1-y2 is: 1st-order, explicit, non-linear

In[21]:=

f[x_,y_]=1-y^2;

ODE = y'[x]==f[x,y[x]]

y'(x)=1-y(x)2

In[22]:=

DSolve[ODE,y[x],x]

{{y(x)→e2⁢x-e2⁢c1e2⁢c1+e2⁢x}}

In[23]:=

Off[Solve::ifun];

sol1[x_] = y[x] /. DSolve[{ODE,y[0]==0},y[x],x][[1,1]];

sol2[x_] = y[x] /. DSolve[{ODE,y[2]==1/2},y[x],x][[1,1]];

{sol1[x],sol2[x]}

{e2⁢x-1e2⁢x+1,3⁢e2⁢x-e43⁢e2⁢x+e4}

In[24]:=

Direction field and solutions

In[24]:=

DirectionField = VectorPlot[{1,f[x,y]},{x,0,2},{y,-1,1},Axes->True,Frame->False,ImageSize->Large,VectorScale->.051,VectorMarkers->None,VectorStyle->Pink];

SolutionPlot = Plot[{sol1[x],sol2[x]},{x,0,2},ImageSize->Large];

plots=Show[{SolutionPlot,DirectionField}];

Export["/home/student/courses/MATH528/HW01Fig02.pdf",plots]

/home/student/courses/MATH528/HW01Fig02.pdf

In[25]:=

Figure 2. PS1.2.2 direction field and solutions passing through (1,1),(0,2)

Problem 3. PS1.1.16

Solution. y'2-x⁡y'+y=0 is 1st-order, non-linear, implicit. Verify solutions y(x)=c(x-c), y(x)=x2/4

In[1]:=

ODE = y'[x]^2 - x y'[x] + y[x] == 0

y'(x)2-x⁢y'(x)+y(x)=0

In[5]:=

sol1[x_]=c(x-c)

c⁢(x-c)

In[6]:=

Simplify[ODE /. y->sol1]

True

In[7]:=

sol2[x_]=x^2/4

x24

In[8]:=

Simplify[ODE /. y->sol2]

True

In[9]:=

DSolve[ODE,y[x],x]

{{y(x)→c1⁢x-c12}}

In[10]:=

DSolve[{ODE,y[0]==0},y[x],x]

{{y(x)→0}}

In[11]:=

Singular solution y(x)=x2/4 is the envelope of all particular solutions.

Problem 4. PS1.1.18

Solution. Decay follows law y'=-k⁡y with solution y(t)=e-k⁡ty(0), The half-life τ satisfies equation

y(τ)y(0)=12=e-k⁡τ⇒-kτ=-log⁡2⇒k=log⁡23.6⁡[1day]

After 1 day y(1)=exp[-log⁡23.6×1]×1⁡[gram]=.825⁡[gram]. After 1 year y∼3×10-31⁡[gram], undetectable since a single atom would weigh 224⁡amu=224×1.66×10-24⁡gram

In[11]:=

k=Log[2.]/3.6; y[t_,y0_]=Exp[-k t] y0

e-0.192541⁢ty0

In[12]:=

y[1.,1.]

0.824861

In[13]:=

y[365.25,1.]

2.870769718761845`*^∧-31

In[14]:=

224 1.66 10^(-24)

3.7184`*^∧-22

In[15]:=

3Projects

3.1PS2.1.16

(a) The larger field suggests a pole in quadrant II

In[28]:=

f[x_,y_] = x + y;

DirectionField = VectorPlot[{1,f[x,y]},{x,-5,2},{y,-1,5},Axes->True,Frame->False,ImageSize->Large,VectorScale->.051,VectorMarkers->None,VectorStyle->Pink];

Export["/home/student/courses/MATH528/HW01Fig03.pdf",DirectionField]

/home/student/courses/MATH528/HW01Fig03.pdf

In[29]:=

Figure 3. Direction field of ODE y'=x+y

(b) From x2+9y2(x)=c differentiation by x gives x+9y⁡y'=0⇒y'=-x/(9y)

In[35]:=

f[x_,y_] = -x/(9y);

DirectionField = VectorPlot[{1,f[x,y]},{x,-3,3},{y,0,3},Axes->True,Frame->False,VectorMarkers->None,VectorScale->.051,VectorStyle->Pink,AspectRatio->Automatic];

Export["/home/student/courses/MATH528/HW01Fig04.pdf",DirectionField]

/home/student/courses/MATH528/HW01Fig04.pdf

In[36]:=

Figure 4. Direction field of ODE y'=-x/(9y)

Figure Implicit equation ODE
circles x2+y2=c x+y⁡y'=0
hyperbolas x⁡y=c y+x⁡y'=0
parabolas y=x2+c y'=2x

Table 1. ODEs corresponding to conics

(c) From Table 1, solutions to y'=-x/y are circles. Confirm by drawing direction field

In[38]:=

f[x_,y_] = -x/y;

DirectionField = VectorPlot[{1,f[x,y]},{x,-2,2},{y,0,2},Axes->True,Frame->False,VectorMarkers->None,VectorScale->.1,VectorStyle->Pink,AspectRatio->Automatic];

Export["/home/student/courses/MATH528/HW01Fig05.pdf",DirectionField]

/home/student/courses/MATH528/HW01Fig05.pdf

In[39]:=

Figure 5. Direction field of ODE y'=-x/(9y)

(d) Solutions to y'=-y/2 are exponentials. Confirm by drawing direction field

In[39]:=

f[x_,y_] = -y/2;

DirectionField = VectorPlot[{1,f[x,y]},{x,-2,2},{y,-2,2},Axes->True,Frame->False,VectorMarkers->None,VectorScale->.1,VectorStyle->Pink,AspectRatio->Automatic];

Export["/home/student/courses/MATH528/HW01Fig06.pdf",DirectionField]

/home/student/courses/MATH528/HW01Fig06.pdf

In[40]:=

Figure 6. Direction field of ODE y'=-x/(9y)