Solving some ODEs

Math 386
Dr. Greene
ODE Review
Spring 2015
Solving some ODEs
1. y 00 + y 0 − 30y = 0,
y(0) = 2,
y 0 (0) = e.
Solution: Substituting the guess y = emx results in m2 emx + memx − 30emx = 0.
Canceling the common emx factors yields the characteristic equation m2 + m − 30 =
(m + 6)(m − 5) = 0. Therefore, m = −6 or m = 5, giving us ODE’s solution
y = C1 e−6x + C2 e5x . We use the two initial conditions to solve for the coefficients:
2 = y(0) = C1 + C2 . and e = y 0 (0) = −6C1 + 5C2 . Adding 6 times the first equation
to the second equation gives 12 + e = 0C1 + 11C2 = 11C2 , so C2 = (12 + e)/11.
Therefore C1 = 2 − C2 = (10 − e)/11. In summary,
y(x) =
10 − e −6x 12 + e 5x
e
+
e .
11
11
2. y 00 + y 0 − 30y = 2x2 .
Solution: The solution is the complementary solution (the solution we found above
to the corresponding homogeneous problem) plus a particular solution. One way to
find a particular solution is using undetermined coefficients. The 2x2 term suggests
Ax2 + Bx + C. Substituting that into the ODE gives
y 00 + y 0 − 30y = 2A + 2Ax + B − 30Ax2 − 30Bx − 30C
= −30Ax2 + (2A − 30B)x + (2A + B − 30C)
= 2x2 + 0x + 0.
It follows that A = −1/15, B = −1/225, C = −31/6750. Therefore,
y=
10 − e −6x 12 + e 5x
1
1
31
e
+
e − x2 −
x−
.
11
11
15
225
6750
Solution: An alternate solution uses the Laplace transform (often a useful tool for
nonhomogeneous differential equations.) Transforming both sides of the differential
equation results in s2 Y (s) − sy(0) − y 0 (0) + sY (s) − y(0) − 30Y (s) = s43 . With the
initial conditions,
4
s2 Y − 2s − e + sY − 2 − 30Y = 3 .
s
Math 386
Dr. Greene
ODE Review
Spring 2015
Solve for Y and using partial fractions,
Y = (4/s3 + 2 + e + 2s)/(s2 + s − 30) =
=−
s3 (s
2+e
4
+
+ 6)(s − 5) (s + 6)(s − 5)
2
541 − 54e
1504 + 125e
1
31
+
+
.
−
−
3
2
15s
225s
6750s 594(s + 6)
1375(s − 5)
Applying the inverse Laplace transform term-by-terms yields an expression equivalent to the other solution above.
3. y 00 − 10y 0 + 25 = 0.
Solution: The characteristic equation m2 − 10m + 25 = (m − 5)2 = 0 has a repeated
root, so the general solution is
y = C1 e5x + C2 xe5x .
The key idea is that powers of x must be multiplied by emx when the characteristic
equation has a repeated factor (m − α).
4. y 00 + 25y = 0.
Solution: The characteristic equation m2 + 25 = 0 has only imaginary solutions
m = ±5i. Therefore, the solution is y = C1 cos(5x) + C2 sin(5x).
5. y 00 + 25y = cos 3x.
Solution: Using undetermined coefficients, a particular solution is y = A cos 3x +
B sin 3x. Substituting,
−9A cos 3x − 9B sin 3x + 25A cos 3x + 25B sin 3x = 16A cos 3x + 16B sin 3x
= cos 3x + 0 sin 3x.
Therefore, A = 1/16 and B = 0. Therefore, the general solution is
1
cos(3x).
16
Note: In this problem, we would have still obtained the correct answer is we only
guessed A cos 3x. However, if there had been a y 0 term in the original ODE, then
ignoring the possibilty B sin 3x would result in a wrong answer.
C1 cos(5x) + C2 sin(5x) +
Math 386
Dr. Greene
6. x2 y 00 + xy 0 − 30y = 0.
ODE Review
Spring 2015
Solution: This is an example of Euler’s equation. Solutions tend to take the form
xm (similar to how we use emx above for constant-coefficients linear differential equations.) When roots of the characeristic equation are repeated, powers of ln(x) must
be multplied by xm .
√
2
30)(m +
Here,
the
characteristic
equation
is
m(m
−
1)
+
m
−
30
=
m
−
30
=
(m
−
√
√
√
− 30
30
30). Therefore, the general solution is y = C1 x
+ C2 x .
√
7. y 0 + sin(x)y = x2 , y(0) = 2. Variation of parameters may be used to solve this
problem, which in the first-order
R case, really is the same as using an integrating factor.
The integrating factor is µ = e sin x dx = e− cos x . Therefore, (ye− cos x )0 = x2 e− cos x .
Therefore,
Z
y = ecos x
x2 e− cos x dx.
It is not clear how to integrate x2 e− cos x or even e−cosx by itself. It is possible the
integral, which exists by continuity, might not exist in closed form using elementary
functions. Other than the form currently given, the next best approach may be to
determine a power series solution. Please note that the integral involves an integration
√
constant. This constant would be determined using the initial condition y(0) = 2.
Note: that a method that would likely work well is to use an integral transform such as
the Laplace transform. However, it will be easiest to rewrite sin(x) = 21 (eix − e−ix )
before applying the transform. The downside is that this formula (some actually take
this as the definition of sin x) and the ensuing integration use complex analysis.