Escolar Documentos
Profissional Documentos
Cultura Documentos
Week 2 Tutorial
by li haohan
HKUST
Abstract
This document is provided as a part of supplemental materials for MATH 2351 Introduction
to Dierential Equations (2016 fall). Although it is written in the hope that it will be useful,
nothing contained in this document represents the ocial views or policies of this course.
Comments and suggestions are welcomed to be sent to the author (hlibb@connect.ust.hk).
(1 + y)y 0 = x ; y(0) = 0
Solution. : (This is known as D'Alembert's equation) First let's try to separate x and y, by writing the equation
into
dy
(1 + y) = x;
dx
which is equivalent to
(1 + y)dy = xdx;
Now, the left hand side explicitly depends on y only, while the right hand side explicitly depends on x only. To
get the solution of the orginal ODE, we intend to calculate the value of y(x) as a function of x. To do that, we
can integrate both sides from the initial point x= 0; y =0 to an arbitrary end point x = x?, y = y? to nd out the
dependence between x? and y?,
Z y= y? Z x=x?
(1 + y)dy = xdx;
y=0 x=0
Realizing that the separation of x and y allows us to calculate the integrals explicitly, we have
1 1 1
(1 + y?)2 = x2?;
2 2 2
that is,
(1 + y?)2 1 = x?2;
Reinterpretating the results, we can say that the solution to the original initial value problem is a hyperbola dened
by the quadratic equation
(1 + y)2 x2 = 1:
then it is suggested to re-check the initial condition on both branches. The plus answer satises the initial condition,
so the solution should be
p
y = 1 + x2 + 1 :
. This document has been written using the GNU TEXMACS text editor (see www.texmacs.org).
1
2. (Demonstration) Model the following rst-order linear ode for y = y(x):
dy dy 1 ex
x + y = ex ) + y= ;
dx dx x x
1 ex
then using integrating factor with p(x) = x and g(x) = x
:
Z x
1
(x) = exp dx
1 x
= jxj
the solution satisfying the initial condition y(x0) = y0 is then commonly written as
Z x
1
y = y0 + (x)g(x)dx
(x)
Z x1 x
1 e
= 0+ jxj dx
jxj 1 x
ex e
=
x
b) y 2 xy 0 = 0, y(1) = 1
c) ex yy 0 + ey x = 0, y(0) = 0
Solution. All the questions can be solved by separation of variables which is shown in Problem 1. If you have any
doubts in any of these questions, you could go back to have a look.
Sage] y = function('y')(x)
Sage] ### for (a) ###
Sage] de1 = diff(y,x)-x^0.5*y^0.5
Sage] simplify(desolve(de1,y,ics=[1,0]))
p 2 3 2
2 y(x) = x 2
3 3
Sage] ### for (b) ###
Sage] de2 = y^2-x*diff(y,x)
Sage] simplify(desolve(de2,y,ics=[1,1]))
1
= log (x) 1
y(x)
Sage] ### for (c) ###
Sage] de3 = diff(y,x)+exp(2*(y-x))
Sage] simplify(desolve(de3,y,ics=[0,0]))
1 (2 x)
(e + e(2 y(x))) e(2 x2 y(x)) = (1)
2
Sage] ### for (d) ###
2
Sage] de4 = diff(y,x) + sin(x)*y
Sage] simplify(desolve(de4,y,ics=[pi/2,1]))
ecos (x)
Sage] ### for (e) ###
Sage] var('y0')
a) x2 y 0 = 1 2xy, y(1) = 2
Solution. (a), (b), (c) are exact, (c) is separable, and (e) can be made exact by multiplying with ex. Solve them
as demonstrated above and check your answers:
Sage] y = function('y')(x)
Sage] ### For (a) ###
Sage] de1 = x^2*diff(y,x) - 1 + 2*x*y
Sage] simplify(desolve(de1,y,ics=[1,2]))
x+1
x2
Sage] ### For (b) ###
Sage] de2 = x^4*diff(y,x) + 4*x^3*y - exp(-x)
Sage] simplify(desolve(de2,y,ics=[1,-1/e]))
e(x)
x4
Sage] ### For (c) ###
Sage] de3 = diff(y,x) + 2*x*y - x
Sage] simplify(desolve(de3,y, ics=[0,1/2]))
1
2
Sage] ### For (d) ###
Sage] de4 = (1+x^2)*diff(y,x) + 2*x*y - 2*x
Sage] simplify(desolve(de4,y,ics=[0,0]))
x2
x2 + 1
Sage] ### For (e) ###
Sage] l = var('l', latex_name=r'\lambda')
Sage] var('a','b')
3
Sage] assume(l>0)
Sage] de5 = diff(y,x) + l*y - a - b*exp(-l*x)
Sage] simplify(desolve(de5,y,ics=[0,0],ivar=x))
(b x + a e(x) a) e(x)
i. Is it linear? If it is, i.e., of the form y 0 + p(x)y = g(x), then an integrating factor is
R
p(x)d x
(x) = e :
ii. Otherwise, try to solve the equations for integrating factors (sometimes it is easier
with tricks like change of variables, but sometimes it is as hard as solving the orginal
ODE).