Homework 3
September 30, 2015
Problem 1
Choose y(x) to extremize the integral
Z
1
y 02 dx
(1)
0
subject to the end conditions y(0) = 0, y(1) = 0 as well as the constrains:
Z
1
ydx = 1
(2)
0
and plot the y(x).
Solution
Z
1
02
y dx
0
(
Z
1
ydx
1) =
0
Z
1
(y 02
y + )dx
(3)
0
We have the Euler-Lagrange equation:
@L
@y
d @L
=0
dx @y 0
(4)
We get y 00 = 2 . Solving last ODE, y = 4 x2 + C1 x + C2 . Applying the
boundary conditions y(0)R= y(1) = 0, we can see that C2 = 0 and +4C1 = 0.
1
+ 6C1 = 12. Finally,
Applying the constrain 0 ( 4 x2 + C1 x)dx =)
C1 = 6 and = 24.
=)
y=
6x2 + 6x
Problem 2
1
(5)
Find the point on the curve of intersection of z
that is closest to the origin.
xy = 10 and x + y + z = 1
Solution
z = 10 + xy
(6)
So, we can rewrite the constrain as follows:
x + y + 10 + xy = 1
(7)
The problem is to minimize the function f (x, y) = x2 + y 2 + (10 + xy)2 with
the constrain x + y + 9 + xy = 0.
So, we have to solve the following system of equations:
2x + 2(10 + xy)y
(1 + y) = 0
2y + 2(10 + xy)x
(1 + x) = 0
x + y + 9 + xy = 0
(8)
(9)
(10)
Where the real solutions are given by:
x = 3, y =
3, and
= 0 or =
3, y = 3, and
=0
(11)
Problem 4
Solve
dy
dx
1 2 1
y + y=0
x2
x
(12)
Solution
Considering a solution of type y = cx. Substituting into di↵erential equation
we got that c=1, so the particular solution is given by y = x. Considering
dy
the change of variable u = xy which implies dx
= d(ux)
= u + x du
. Thus, the
dx
dx
du
2
di↵erential equation becomes: x dx u + 2u = 0.Integrating both parts:
2
1
ln(2
2
1
ln(u) = ln(x) + C
2
2
u=
1 + Kx2
u)
(13)
(14)
(15)
Finally, the solution is given by:
y=
2x
1 + Kx2
(16)
Problem 5
Solve boundary value problem
dy
d2 y
=0
+y
2
dx
dx
Where y(0) = 0 and y( ⇡2 ) =
1
Considering the following change of variables: u =
. The original equation becomes:
u du
dy
dy
,
dx
so
d2 y
dx2
=
du
dx
=
du dy
dy dx
=
du
+ yu = 0
dy
(18)
du
du
+ y) = 0 =) u = 0 or
+y =0
dy
dy
(19)
u
u(
(17)
If u = 0 =) y = C1 x + C2 . Applying the boundary conditions =)
y = ⇡2 .
2
If du
+ y = 0 =) y = 2y + C3 . So, dx = y22+C3 dy. Integrating the
dy
last equation we get: C3 arctan(C3 y) = x2 + C4 . Applying the boundary
conditions =) C3 = 1 and C4 = 0. Thus, y = tan( x2 ).
Finally, the solutions are:
3
y=
x
tan( ) and y =
2
2
⇡
(20)
Problem 7
Solve
d3 y
dx3
3
d2 y
+ 4y = 0
dx2
(21)
Solution
The characteristic equation is given by
r3
3r2 + 4 = 0
(22)
Since r1 = 2, r2 = 2 and r3 = 1, the general solution of the di↵erential
equation is:
y(x) = C1 exp(2x) + C2 x exp(2x) + C3 exp(x)
(23)
d2 y
dy
+ 4y
+C
2
dx
dx
(24)
Problem 8
Solve
For (a) C=6, (b) C=4, and (c) C=3 with y(0) = 1 and y 0 (0) =
results
3. Plot
Solution
(a) The characteristic
equation is p
given by r2 + 6r + 4 = 0 which solutions
p
are r1 = 3
5 and r2 = 3 + 5:
4
p
p
5)x) + C2 exp(( 3 + 5)x)
y(x) = C1 exp(( 3
(25)
(b) The characteristic equation is given by r2 + 4r + 4 = 0 which solutions
are r1 = 2 and r2 = 2:
y(x) = C1 exp( 2x) + C2 x exp( 2x)
(26)
2
(c) The characteristic
p equation is given by rp+ 4r + 3 = 0 which solutions
are r1 = 1/2( 3 i 7) and r2 = 1/2( 3 + i 7):
p
p
3
7
7
x) + C2 cos(
x)
y(x) = exp( x)(C1 sin(
2
2
2
(27)
Problem 9
Find the Green’s function for the equation:
u0000 = f (x)
(28)
with u(0) = u00 (0), u0 (0) = 2u0 (1), u(1) = a
For 0 < x < s:
x3
x2
g1 (x, s) = A1 + A2 + A3 x + A4
6
2
(29)
x3
x2
+ B 2 + B 3 x + B4
6
2
(30)
For s < x < 1:
g2 (x, s) = B1
We have 8 unknowns and we need 8 equations, so:
5
u(0) = 0 A4 = 0
u00 (0) = 0 A2 = 0
1
u0 (0) = 2u0 (1) A3 = B1 + B2 + B3
2
1
1
u(1) = a B1 + B2 + B3 + B4 = a
6
2
s3
s3
s2
g1 (s) = g2 (s), A1 + A3 s = B1 + B2 + B3 s + B4
6
6
2
2
s
s2
g10 (s) = g20 (s), B1 + B2 s + B3 ( A1 + A3 ) = 1
2
2
A1 s = 1
g100 (s) = g200 (s), B1 s + B2
000
000
g2 (s) g1 (s) = 1, B1 A1 = 1
(31)
(32)
(33)
(34)
(35)
(36)
(37)
(38)
Problem 10
Find the Green’s function solution of:
y 00 + 4y = f (x)
(39)
with y(0)=y’(1), y’(0)=0. Verify that this is the correct solution when f (x) =
x2
Solution
We have to solve the homogeneous part of the di↵erential equation given by:
g 00 + 4g = 0
(40)
g = K1 sin(2x) + K2 cos(2x)
(41)
Which solution is given by:
For 0 < x < s:
6
g1 (x, s) = A1 sin(2x) + A2 cos(2x)
(42)
g2 (x, s) = B1 sin(2x) + B2 cos(2x)
(43)
For s < x < 1:
We have 4 unknowns and we need 4 equations, so:
y(0) = y(1), A1 = 0
y (0) = 0, /A2 = B1 sin(2) + B2 cos(2)
g1 (s) = g2 (s), A2 cos(2s) = B1 sin(2s) + B2 cos(2s)
g1 (s) = 1, 2B1 cos(2s) 2B2 sin(2s) + 2A2 sin(2s) = 1
0
g2 (s)
7
(44)
(45)
(46)
(47)
Homework 5
September 30, 2015
Problem 1 Find the lowest order solution for:
✏2 y 00 + ✏y 2
y+1=0
(1)
with y(0)=1, y(1)=3, where ✏ is small. For ✏=0.2, plot the asymptotic and
exact solutions.
Consider ✏=0, so:
yinner = 1
(2)
Which it matches with the boundary condition y(0)=1. Now consider the
following change of variables:
⌘=
x
1
✏↵
(3)
So, equation 1 becomes:
✏2
2↵ 00
y + ✏y 2
y+1=0
(4)
Choosing ↵=1, equation 4 becomes:
y 00 + ✏y 2
y+1=0
(5)
Considering ✏=0 and solving the di↵erential equation (equation 5):
youter = A exp( ⌘) + B exp(⌘) + 1
(6)
Applying the boundary condition y(1)=3 or in terms of ⌘ y(0)=3, we get
that:
B=2
A
1
(7)
The outer solution becomes:
youter = A exp( ⌘) + (2
A) exp(⌘) + 1
(8)
For matching outer and inner solutions we have to impose the following
condition:
lim A exp( ⌘) + (2
A) exp(⌘) + 1 = 1
⌘! 1
(9)
In order to fulfill with last condition (equation 9), we impose that A=0, so
the outer solution becomes:
youter = 1 + 2 exp(⌘)
(10)
Or using original variables, outer solution becomes:
youter = 1 + 2 exp(
x
1
✏
)
(11)
Finally, the solution is given by:
y = yinner + youter
ycommon = 1 + 1 + 2 exp(
2
x
1
✏
)
1 = 1 + 2 exp(
x
1
✏
) (12)
Problem 2 Solve to leading order
✏y 00 + yy 0
y=0
(13)
with y(0)=0, y(1)=3. Compare graphically with the exact solution for ✏=0.2.
Solution
Considering ✏ = 0 we go the following:
yy 0
y=0
(14)
Where the solutions the solution of equation 14 are:
yy 0
y=0
(15)
Which implies:
y0 = 0, y0 = x + C
(16)
Applying the boundary condition y(1)=3 in order to get outer solution:
youter = x + 2,
(17)
We define:
⌘=
x
,
✏↵
(18)
Substituting equation 18 into equation 14 we get:
✏1
2↵ 00
y +✏
↵
yy 0
3
y=0
(19)
Which implies:
1
2↵ =
↵, ↵ = 1
(20)
✏y = 0
(21)
So, equation 18 becomes:
y 00 + yy 0
Considering ✏ = 0 and solving equation 21:
yinner =
p p
p p
1 p p
2 C1 tanh( ( 2 C1 ⌘ + 2 C1 C2 )
2
(22)
Applying the boundary condition y(0) = 0 into yinner , we get:
yinner =
p p
1 p p
2 C1 tanh( ( 2 C1 C2 ) = 0
2
(23)
Which implies C2 = 0
Applying limits in order to math inner and outer solutions:
lim yinner =
⌘!1
p p
2 C1 = youter (0) = 2
K1 =
p p
2 C1 = 2
(24)
(25)
So, the inner solution is given by:
x
yinner = 2 tanh(⌘) = 2 tanh( )
✏
(26)
And the final solution is given by:
y = youter + yinner
x
youter = x + 2 + 2 tanh( )
✏
4
x
2 = x + 2 tanh( ) (27)
✏
Problem 3 For small ✏, solve to lowest order using the method of multiple
scales
x00 + ✏x0 + x = 0
(28)
with x(0)=1, x’(0)=1. Compare exact and asymptotic results for ✏=0.3.
Solution
x(t) = exp( 0.5✏t) sin(t)
5
(29)
Problem 4 For small ✏, solve using the WKBJ method
✏2 y 00 = (1 + x2 )2 y
(30)
with y(0)=0, y(1)=1. Plot asymptotic and numerical solutions for ✏=0.11.
Solution
The di↵erential equation can be written as:
✏2 y 00 = f (x)y
(31)
f (x) = (1 + x2 )2
(32)
Where:
S0 (x) = ±
S1 (x) =
p
0.5
(1 + x2 )2
df
dx
4f (x)
6
=
x
1 + x2
(33)
(34)
So, the solution is given by:
y(x) = p
1
C2
1
1
1
C1
)) + p
))
exp( ( 3
exp( ( 3
2
2
✏ x +1
✏ x +1
1+x
1+x
(35)
Applying the boundary conditions y(0) = 0 and y(1) = 1 we get:
1
7.7 ⇥ 10 6
1
))
y(x) = p
exp( ( 3
2
✏ x +1
1+x
7.7 ⇥ 10 6
1
1
p
))
exp( ( 3
2
✏ x +1
1+x
(36)
Problem 5 A pendulum is used to measure the earth’s gravity. The frequency of oscilation is measured, and the gravity is calculated assuming a
small amplitude of motion and knowing the length of the pendulum. What
must the maximum initial angular displacement of the pendulum be if the
error in gravity is to be less than 1%?. Neglect air resistance.
Solution
d2 ✓ g
+ sin(✓) = 0
dt2
l
7
(37)
For small ✓, we can approximate sin(✓) ⇡ ✓. Thus, the governing equation
becomes:
d 2 ✓ gm
sin(✓) = 0
+
dt2
l
(38)
We have the following relation:
sin(✓)
gm
=
< 0.99
g
✓
(39)
Since, the error in gravity is to be less than 1%. Which implies:
✓max ⇡ 14.04
8
(40)
HOMEWORK 11
ClearAll
r = 2.2;
LastRecurrenceTablea[n + 1] ⩵ r * a[n] * 1 - a[n], a[0] ⩵ 0.1, a, {n, 0, 10 000}
ClearAll
0.545455
Printed by Wolfram Mathematica Student Edition
(*Thomas Storey, AME60611, 1282015, #1,b*)
j = 100; (*this is the number of iterations*)
q = 500;(*this is the max. the growing number of fixed points*)
end = 4;
calc = TableParallelTable
DropRecurrenceTablea[n + 1] ⩵ r * a[n] * 1 - a[n], a[0] ⩵ 0.3, a, {n, j + g},
j + g, r, 1 j, end, 1 j, {g, 0, q, 1};
(*calculate all of the values of fixed points*)
nice = Round[calc, 0.005];
nicer = Flatten[nice];
arr = PadLeftTablei, i, 1 j, end, 1 j, end * j * q + 1,
Tablei, i, 1 j, end, 1 j; (*generates the r values for the x-axis*)
result = Transpose[{arr, nicer}];
ListPlot[result, PlotStyle → {Orange},
AxesLabel → {"r", "x bar"}, LabelStyle → Medium]
x bar
1.0
0.8
0.6
0.4
0.2
1
2
Printed by Wolfram Mathematica Student Edition
3
or more
SEE CLASSMATE'S
SOLUTION FOR PLOTS
SAMPLE
SOLUTION
© Copyright 2026 Paperzz