Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

homeworks

Views: 76
Kernel: SageMath (stable)

#2: Transform IVP dy/dt=1y3dy/dt=1-y^3; y(1)=3y(-1)=3 into an equivalent problem with the initial point at the origin.

Sol'n: Replace tt+1t\leftarrow t+1 and yy3y\leftarrow y-3 and the IVP becomes dy/dt=1(y3)3dy/dt=1-(y-3)^3; y(0)=0y(0)=0

This ode is separable so we can solve it: dy1y3dy=dt\int \dfrac{dy}{1-y^3}dy=\int dt

#4Suppose y=y/2+ty'=-y/2+t; y(0)=0y(0)=0. Let ϕ0(t)=0\phi_0(t)=0 and define {ϕn(t)}\{\phi_n(t)\} by the method of successive approximations: ϕn+1(t)=0tf(s,ϕn(s))ds\phi_{n+1}(t)=\displaystyle\int\limits_0^tf(s,\phi_n(s))ds

a. Determine ϕn(t)\phi_n(t) for an arbitrary value of nn.

The plan is to compute successive approximations and try to suss out a pattern.

Sol'n: ϕ1(t)=0tf(s,0)ds=0tsds=s220t=t22\phi_1(t)=\displaystyle\int\limits_0^tf(s,0)ds=\int\limits_0^tsds=\dfrac{s^2}{2}\Big|_0^t=\dfrac{t^2}{2}
ϕ2(t)=0tf(s,s2/2)ds=0ts24+sds=s312+s220t=t312+t22=t32(32)+t22\phi_2(t)=\displaystyle\int\limits_0^tf(s,s^2/2)ds=\int\limits_0^t-\dfrac{s^2}{4}+s\,ds=\dfrac{-s^3}{12}+\dfrac{s^2}{2}\Big|_0^t=-\dfrac{t^3}{12}+\dfrac{t^2}{2}=-\dfrac{t^3}{2\cdot(3\cdot 2)}+\dfrac{t^2}{2}

ϕ3(t)=0tf(s,s3/(2(32))+s2/2)ds=0ts322(32)s222+sds=s4224!s32(32)+s220t=t4224!t32(32)+t22=k=24(1)ktk2k2k!=k=044(t/2)kk!+2t4\phi_3(t)=\displaystyle\int\limits_0^tf(s,s^3/(2(3\cdot 2))+s^2/2)ds=\int\limits_0^t\dfrac{s^3}{2^2(3\cdot 2)}-\dfrac{s^2}{2\cdot 2}+s\,ds=\dfrac{s^4}{2^2*4!}-\dfrac{s^3}{2(3\cdot 2)}+\dfrac{s^2}{2}\Big|_0^t=\dfrac{t^4}{2^2*4!}-\dfrac{t^3}{2(3\cdot 2)}+\dfrac{t^2}{2}=\sum\limits_{k=2}^4\dfrac{(-1)^kt^k}{2^{k-2}k!}=\sum\limits_{k=0}^4\dfrac{4(-t/2)^k}{k!}+2t-4

The pattern will persist, so that ϕn=k=0n+14(t/2)kk!2t+44et/2+2t4\phi_n=\sum\limits_{k=0}^{n+1}\dfrac{4(-t/2)^k}{k!}-2t+4\rightarrow 4e^{-t/2}+2t-4 as nn\rightarrow\infty

Well, that's enough hard pencil and paper work. Here's a little script for cranking these things out...and graphing them!

s,t = var('s t') phi = function('phi')(s) def f(t,y): return -y/2+t phi=integral(f(s,0),(s,0,t)) show(phi) p1 = plot(phi,(t,0,6)) for i in xrange(1,5): phi = integral(-phi(s)/2+s,(s,0,t)) show(phi) p1 += plot(phi,(t,0,6)) p1+=plot(4*e^(-t/2)+2*t-4,(t,0,6),color='red') show(p1)
Image in a Jupyter notebook

b. Plot ϕn(t)\phi_n(t) for n=1,,4n=1,\dots,4. Observe whether the iterates appear to be converging.

SOLN: See above. Looks good!

c. Express limnϕn(t)=ϕ(t)\lim\limits_{n\rightarrow\infty}\phi_n(t)=\phi(t) in terms of elementary functions; that is, solve the given initial value problem.

SOLN: This was worked out above by sussing out the pattern of the Taylor series for et/2e^{-t/2}. Shall we give it a go the other way?
The ode is linear: dydt+12y=t\dfrac{dy}{dt}+\dfrac{1}{2}y=t has the integrating factor et/2e^{t/2}, so we have ddt(et/2y)=tet/2\dfrac{d}{dt}\left(e^{t/2}y\right)=te^{t/2} whence et/2y=2(t2)et/2+ce^{t/2}y=2(t-2)e^{t/2}+c
The initial conditions require 0=4+c0=-4+c, so c=4c=4 and the solution is y=2(t2)+4et/2y=2(t-2)+4e^{t/2}

#8. Consider y=1y3,y(0)=0y'=1−y^3, y(0)=0
let ϕ0(t)=0\phi_0(t)=0 and use the method of successive approximations to approximate the solution of the initial value problem.
a. Calculate ϕ1(t),,ϕ3(t)\phi_1(t),\dots,\phi_3(t).

SOL'N: Here, yy is autonomous, so we can write y=f(y)y'=f(y)
ϕ1(t)=0tf(0)ds=0t1ds=s0t=t\phi_1(t)=\displaystyle\int\limits_0^tf(0)ds=\int\limits_0^t1ds=s\Big|_0^t=t
ϕ2(t)=0tf(s)ds=0t1s3ds=ss440t=tt44\phi_2(t)=\displaystyle\int\limits_0^tf(s)ds=\int\limits_0^t1-s^3\,ds=s-\dfrac{s^4}{4}\Big|_0^t=t-\dfrac{t^4}{4}

ϕ3(t)=0tf(ss4/4)ds=0t1(ss44)3ds=tt44+3t7743t101042+t131343\phi_3(t)=\displaystyle\int\limits_0^tf(s-s^4/4)ds=\int\limits_0^t1-\left(s-\dfrac{s^4}{4}\right)^3\,ds=t-\dfrac{t^4}{4}+\dfrac{3t^7}{7\cdot 4}-\dfrac{3t^{10}}{10\cdot 4^2}+\dfrac{t^{13}}{13\cdot 4^3}

b. Plot ϕ1(t),,ϕ3(t)\phi_1(t),\dots,\phi_3(t) Observe whether the iterates appear to be converging.

t = var('t') p2 = plot(t,(t,0,2)) p2 += plot(t-t^4,(t,0,2)) p2 += plot(t-t^4/4+3*t^7/28-3*t^10/160+t^13/(13*64),(t,0,2),color='red') show(p2)
Image in a Jupyter notebook

It doesn't look great...what's going on? Well, the equation is separable so we can solve it in explicit, closed form:
dy1y3=dt\displaystyle\int\dfrac{dy}{1-y^3}=\int dt

Being lazy, I'll use Python's numpy to get the antiderivative:

y=var('y') show(integral(1/(1-y^3),y))

...and...moving right along!

#10 Consider y=3t2+4t+22(y1),y(0)=0y'=\dfrac{3t^2+4t+2}{2(y-1)},y(0)=0
Let ϕ0(t)=0\phi_0(t)=0 and use the method of successive approximations to approximate the solution of the initial value problem.

a. Calculate ϕ1(t),,ϕ4(t)\phi_1(t),\dots, \phi_4(t), or (if necessary) Taylor approximations to these iterates. Keep terms up to order six.

SOLN:

ϕ1(t)=0tf(s,0)ds=0t3s222s1ds=s32s2s0t=t32t2t\phi_1(t)=\displaystyle\int\limits_0^tf(s,0)ds=\int\limits_0^t\dfrac{-3s^2}{2}-2s-1\,ds=\dfrac{-s^3}{2}-s^2-s\Big|_0^t=\dfrac{-t^3}{2}-t^2-t
ϕ2(t)=0tf(s,s32s2s)ds=0t3s2+4s+2s3+2s2+2s+2ds=lnt3+2t2+2t+2+ln(2)\phi_2(t)=\displaystyle\int\limits_0^tf(s,\dfrac{-s^3}{2}-s^2-s)ds=-\int\limits_0^t\dfrac{3s^2+4s+2}{s^3+2s^2+2s+2}\,ds=-\ln|t^3+2t^2+2t+2|+\ln(2)

s,t = var('s t') assume(t>0)phi = function('phi')(s) def f(t,y): return (3*t^2+4*t+2)/(2*(y-1)) phi=integral(f(s,0),(s,0,t)) show(phi) p1 = plot(phi,(t,0,6)) for i in xrange(1,3): #phi = -phi(s)/2+s phi(t)=integral(f(s,phi(s)),(s,0,t)) show(phi) p1 += plot(phi,(t,0,6)) p1+=plot(1+sqrt(t^3+2*t^2+2*t+1),(t,0,6),color='red') p1+=plot(1-sqrt(t^3+2*t^2+2*t+1),(t,0,6),color='red') show(p1)
WARNING: Some output was deleted.
p1+=plot(1+sqrt(t^3+2*t^2+2*t+1),(t,0,6),color='red') p1+=plot(1-sqrt(t^3+2*t^2+2*t+1),(t,0,6),color='red') show(p1)
Image in a Jupyter notebook
t=var('t') y = function('y')(t) de = 2*(y-1)*diff(y,t)-3*t^2-4*t-2 h = desolve(de, y,ics=[0,0]) show(h)

#14 If f/y\partial f/\partial y is continuous in the rectangle DD, show that there is a
positive constant KK such that f(t,y1)f(t,y2)Ky1y2|f(t,y_1)−f(t,y_2)|\leq K|y_1−y_2|, (31)
where (t,y1)(t,y_1) and (t,y2)(t,y_2) are any two points in DD having the same tt coordinate.
This inequality is known as a Lipschitz condition.
Hint: Hold tt fixed and use the mean value theorem on ff as a function
of yy only. Choose KK to be the maximum value of f/y|\partial f/\partial y| in DD.

SOLN: Fix a value of tt so that the vertical line segment in the tyty plane from (t,y1)(t,y_1) to (t,y2)(t,y_2) is contained in the rectangle, DD.
Following the hint, we recall that the mean value theorem guarantees that if y=f(t,y)y=f(t,y) is differentiable
on (y1,y2)(y_1,y_2) then there exists c(y1,y2)c\in(y_1,y_2) such that (y2y1)f(t,c)=f(t,y2)f(t,y1)(y_2-y_1)f'(t,c)=f(t,y_2)-f(t,y_1).
Swapping sides, and equating the absolute values, f(t,y2)f(t,y1)=f(t,c)(y2y1)|f(t,y_2)-f(t,y_1)|=|f'(t,c)||(y_2-y_1)|
Since, by assumption, ff is continuous in the interval, f(t,y)|f'(t,y)| is bounded by some finite value, KK.

#15 and 16 If ϕn1(t)\phi_{n−1}(t) and ϕn(t)\phi_n(t) are members of the sequence {ϕk(t)}\{\phi_k(t)\}, use
the result of Problem 14 to show that f(t,ϕn(t))f(t,ϕn1(t)Kϕn(t)ϕn1(t)f'(t,\phi_n(t))−f'(t,\phi_{n−1}(t)\leq K|\phi_n(t)−\phi_{n−1}(t)|.

SOLN: Proof by induction may work here. Start with ϕ1(t)ϕ0(t)=ϕ1(t)0tf(s,0)dsMs0t=Mt\phi_1(t)-\phi_0(t)|=|\phi_1(t)|\leq\displaystyle\int\limits_0^t|f(s,0)|ds\leq Ms\Big|_0^t=Mt
where MM is an upper bound on the partial derivative in DD.
Further, look at ϕ2(t)ϕ1(t)=0t(f(s,ϕ1(s))f(s,0))ds0tf(s,ϕ1(s))f(s,0))ds|\phi_2(t)-\phi_1(t)|=\Big|\displaystyle\int_0^t(f(s,\phi_1(s))-f(s,0))ds\Big|\leq\int_0^t\Big|f(s,\phi_1(s))-f(s,0))\Big|ds
This was shown in problem 14, to be 0tKϕ1(s)0dsKN0tsds=12KMt2\leq\displaystyle\int_0^tK|\phi_1(s)-0|ds\leq KN\int_0^t|s|ds=\dfrac{1}{2}KMt^2
Now the inductive hypothesis is that ϕk(t)ϕk1(t)MKk1tkk!|\phi_k(t)-\phi_{k-1}(t)|\leq\dfrac{MK^{k-1}t^k}{k!} for some kk. Then
ϕk(t)ϕk1(t)0tf(s,ϕk(s))f(s,ϕk1(s))ds0tKϕk(s)ϕk1(s)ds0tKMKk1skk!ds=MKktk+1(k+1)!|\phi_k(t)-\phi_{k-1}(t)|\leq\displaystyle\int_0^t|f(s,\phi_k(s))-f(s,\phi_{k-1}(s))|ds\leq\int_0^tK|\phi_k(s)-\phi_{k-1}(s)|ds\leq\int_0^tK\dfrac{MK^{k-1}s^k}{k!}ds=\dfrac{MK^kt^{k+1}}{(k+1)!}, completing the proof by induction.

#17. Note that ϕn(t)=ϕ1(t)+(ϕ2(t)ϕ1(t))++(ϕn(t)ϕn1(t))\phi_n(t)=\phi_1(t)+(\phi_2(t)-\phi_1(t))+\cdots+(\phi_n(t)-\phi_{n-1}(t))
a. Then, by the triangle inequality, ϕn(t)ϕ1(t)+ϕ2(t)ϕ1(t)++ϕn(t)ϕn1(t)|\phi_n(t)|\leq |\phi_1(t)|+|\phi_2(t)−\phi_1(t)|+\cdots+|\phi_n(t)−\phi_{n−1}(t)|.
b. And by the results of Problem 16, if t<h|t|<h, then ϕ1\phi_1 is bount by the "bow tie" and so ϕ1(t)Mh\phi_1(t)\leq Mh.
Further, each successive difference has ϕn(t)ϕn1(t)MKn1hnn!|\phi_n(t)-\phi_{n-1}(t)|\leq\dfrac{MK^{n-1}h^n}{n!}.
Thus by the triangle inequality, ϕn(t)MK(Kh+(Kh)22!++(Kh)nn!)|\phi_n(t)|\leq \dfrac{M}{K}\left(Kh+\dfrac{(Kh)^2}{2!}+\cdots+\dfrac{(Kh)^n}{n!}\right).

c. Show that the sum in part b converges as nn\rightarrow\infty and, hence,
the sum in part a also converges as nn\rightarrow\infty. Conclude therefore
that the sequence {ϕn(t)}\{\phi_n(t)\} converges since it is the sequence of,br> partial sums of a convergent infinite series.

SOLN: The sequence of partial sums converges to MK(eKh1)MK(e^{Kh}-1). Using the comparison test
(remember Chapter 11 of 1B?!) the terms of part a must also converge and so the nnth term must go to zero: ϕn(t)ϕn1(t)0{ϕn(t)}|\phi_n(t)-\phi_{n-1}(t)|\rightarrow 0\Rightarrow \{\phi_n(t)\} is convergent.