Faculty of Science, Technology, Engineering
and Mathematics
Tutor Notes
M820 Calculus of variations and
advanced calculus
M820 TUTOR NOTES 1 2021J CONFIDENTIAL
M820 21J PRESENTATION The questions in this assignment add up to 100 marks.
If students have problems with questions from Chapters 1 and 2, you might like to
refer them to the Diagnostic Quiz found at
https://mcs-notes2.open.ac.uk/WebResources/Maths.nsf/A/1jpl/$FILE/MScDiagnosticquiz.pdf
TMA 01 Cut-off date 1 December 2021
Solution to Question 1 – 30 marks
(a) Equation (i) Second-order, linear, boundary value problem.
Equation (ii) First-order, nonlinear, initial value problem.
Equation (iii) First-order, nonlinear, initial value problem.
Equation (iv) Second-order, linear, initial value problem.
Remark: This material is in Section 3.3 of the module notes. Linear/nonlinear 2 marks per equation
is covered in Ex. 3.6; IVP/BVP is covered in Ex. 3.7.
8 Subtotal
(b) (i) The substitution x = et transforms the given ODE into
d2 y dy
2
+2 + 5y = 8et ,
dt dt
the general solution of which is
y = αe−t cos 2t + βe−t sin 2t + et .
Changing back to x gives
y = (α cos(2 ln x) + β sin(2 ln x))/x + x . 2 general solution
Applying the boundary conditions gives α = −β = 1, so that the
particular solution is
y = (cos(2 ln x) − sin(2 ln x))/x + x . 1 particular solution
Remark: Equation (i) is an example of Euler’s equation, covered in
Subsection 2.4.6 of the course notes. Ex. 2.44 and Ex. 2.49(b) are similar.
(ii) For y > 0 then we have y 0 = y/3 − 3, the solution to which is
y = 9 + αex/3 ; to satisfy y(0) = 1 gives y = 9 − 8ex/3 . This solution is
positive for 0 ≤ x < 3 ln(9/8). 1 soln of first ODE
0
For x ≥ 3 ln(9/8) the ODE becomes y = −y/3 − 3, with solution
y = βe−x/3 − 9. 1 soln of second ODE
Continuity of y(x) at x = 3 ln(9/8) gives β = 81/8, and, noting that
−x/3
−9 + 81
8 e < 0 for all x > 3 ln(9/8), the solution is
(
9 − 8ex/3 , 0 ≤ x < 3 ln(9/8),
y(x) = −x/3
−9 + 81
8 e , x ≥ 3 ln(9/8)
1 final answer
Copyright c 2021 The Open University
(iii) This is a Bernoulli equation. Write z = y 1−2 = y −1 . Then
dy/dx = −1/z 2 dz/dx, so the ODE becomes
dz
−x + z = x4
dx
which may be written as
dz z
− = −x3 ,
dx x
a first-order linear equation which may readily be solved by the
integrating factor method. Integrating factor is 1/x and the general
solution is
x4
z = αx − ,
3
so that, using the initial condition z(1) = 1/y(1) = 1, we have α = 4/3
and finally we obtain
3
y = z −1 = . 2 solving the ode
x(4 − x3 )
1 final answer
(iv) This is a second-order inhomogeneous constant coefficient equation with
auxiliary equation m2 + ω 2 = 0 with solutions m = ±iω. The
complementary function is therefore
yC = α sin aω + β cos ωx ,
for arbitrary constants α, β. Since the right-hand side is a sin ωx, which is
a solution of the homogeneous function, we seek a particular integral of
the form x(A sin ωx + B cos ωx). Substituting into the ODE gives A = 0
and B = −a/(2ω) and the general solution is therefore
ax cos ωx
y = α sin ωx + β cos ωx − .
2ω
The two initial conditions give:
β=0
a
ω(α − β) − =1
2ω
These simultaneous equations may be readily solved to yield
1 a
α= + , β = 0,
ω 2ω 2
and so
2ω + a ax cos ωx
y= sin ωx − . 2 solving the ode
2ω 2 2ω
1 final answer
12 Subtotal
(c) (i) For w = u2 /u1 , 1 for w0
u1 u02 − u01 u2 W (u1 , u2 )
w0 = = ,
u21 u21
where W (u1 , u2 ) is the Wronskian of u1 and u2 . Now, from (2.34) in the
course notes, or by direct calculation, W (u1 , u2 ) = c, a constant, non-zero 1 for W (u1 , u2 ) = c
because u1 and u2 are linearly independent. 1 c nonzero
3 Subtotal
page 2 of 10
(ii) For y = −2u01 /u1 , then
y2 2(u1 u001 − u02
1 ) 1 4u02 u001 2 −f u1
y0 − =− − 1
= −2 =− = f. 2 proof
2 u21 2 u21 u1 u1 2
2 Subtotal
(iii) w = u2 /u1 and w0 = c/u21 , so
w00 −2cu01 /u31 u01
= = −2 = y.
w0 c/u21 u1
Therefore, by (ii), 1 w00 /w0
0 2
w00 w00 y2
1
− = y0 − = f,
w0 2 w0 2
as required. 1 final result
2 Subtotal
(iv) Apply the above with f = 2. The general solution of u00 + u = 0 is
u1 = A1 cos x + B1 sin x,
with A1 , B1 constants. Another, linearly independent, solution is 1 u1
u2 = A2 cos x + B2 sin x,
where A2 and B2 are constants with (A1 , B1 ) and (A2 , B2 ) linearly 1 u2
independent 2-vectors, so that u1 , u2 are not identically zero.
Thus the general solution of
00 0 2
w 1 w00
− =2
w0 2 w0
is
A2 cos x + B2 sin x
w= . 1 final answer
A1 cos x + B1 sin x
3 Subtotal
Remark: The Wronskian is defined in equation (3.33) in the course notes.
Ricatti’s equation is in Section 3.4.5.
Please point out to students the importance of checking that the number of
arbitrary constants is appropriate for the differential equation being solved. In
this case we expect three (from a third-order) and this can be achieved by
dividing the expression for w by one of the constants which is non-zero, A1
(say), and renaming the three remaining constants.
30 Total for Question 1
Solution to Question 2 – 9 marks
(a)
∂ n−1 p 2 p
G(y, z) = z y y + z 2 − y n−1 y 2 + z 2
∂z
1 2z p
= zy n−1 p − y n−1 y 2 + z 2
2 y +z2 2
!
n−1 z2 p
2 2
=y p − y +z . 2 formula for
y2 + z2 G(y, z)
page 3 of 10
Solving G(y, z) = c for z gives
!
n−1 z2 p
y p − y2 + z2 =c
y2 + z2
p
y n−1 z 2 − y 2 − z 2 = c y 2 + z 2
p
−y n+1 = c y 2 + z 2
y 2n+2 = c2 y 2 + z 2
c2 z 2 = y 2 y 2n − c2
p
±cz = y y 2n − c2 , since y 2n ≥ c2 ,
p
and so z = ±(y/c) y 2n − c2 . 1 Solving for z
1 ± in final formula
4 Subtotal
(b) We solve the differential equation
c2 y 02 = y 2 y 2n − c2
(∗)
by taking a square root
p
±cy 0 = y y 2n − c2 , 1 taking the square root
and separating the variables to give
dy
±c p = dx . 1 separating the
y y 2n − c2 variables
Integrating using the hint gives
1 c
±c arccos = x + b,
nc yn
where b is a constant of integration. Solving for y gives (since cos is even)
1/n
c
y= . (∗∗) 1 solution with
cos (nx + nb) two constants
To determine c and b we note that y 2n ≥ c2 > 0, thus y 6= 0 so, from (∗)
evaluated at x = 0, using y 0 (0) = 0, we have y(0)2n = c2 . Evaluating the
formula (∗∗) for y at x = 0 gives (on taking the 2nth power)
c2
y(0)2n = 2
cos (nb)
so that cos (nb) = ±1. Now since y(x) 6= 0 for 0 ≤ x ≤ a (as can clearly be seen
from (**)) and y(a) = A > 0, it follows from (**) and c > 0 that cos (nb) = 1.
Since nb is only defined up to a multiple of 2π, without loss of generality, we
may take nb = 0 and so
1/n
c
y= . 1 b=0
cos (nx)
Alternatively, differentiating (∗∗) at x = 0 gives
c1/n
0 = y 0 (0) = − sin (nb) ,
(cos (nb))1/n+1
from which we also deduce that b = 0, without loss of generality. (The case
nb = π (or an odd multiple of π) is inconsistent with (∗∗) evaluated at x = 0 as
argued above.)
page 4 of 10
Evaluating at x = a gives
c
An =
cos (na)
so c = An cos (na) and so
1/n
cos (na)
y(x) = A . 1 Right answer
cos (nx)
Finally we note that the solution is well defined and smooth on −a ≤ x ≤ a
provided na < π/2,
5 Subtotal
Remark: This exercise gives valuable practice in the sort of problems that crop up
frequently in the Calculus of Variations part of the module.
Students may not get all the nuances in the solution e.g. na < π/2. Please do not
penalize them for these omissions, but do please point them out in your feedback.
Students may not use (∗) to make use of the condition y 0 (0) = 0. Instead they may
differentiate the formula (∗∗) which readily gives the same result: b = 0. I have
given both methods.
Students might conclude from the wording of the question that A, a and c are
independent constants, while in fact they are related. If this is the case, please do
not penalise this misunderstanding.
9 Total for Question 2
Solution to Question 3 – 15 marks
(a) We have
Z 2
d
S[y + h] = dx (6(y 0 + h0 )h0 − 4(y + h)h).
d 1
On putting = 0 we obtain 1 d/dS[y + h]
Z 2
∆S[y, h] = dx (6y 0 h0 − 4yh),
1
and, using integration by parts, 1 Gâteaux differential
Z 2 Z 2 Z 2
0 0 0 2 00
dx 6y h = [6y h]1 − dx 6y h = − dx 6y 00 h, 1 Integration by parts
1 1 1
since h(1) = h(2) = 0. Hence the Gâteaux differential is 1 h(1) = h(2) = 0
Z 2
∆S[y, h] = − dx (6y 00 + 4y)h.
1
Thus ∆S[y, h] = 0 for all h only if
Z 2
dx (6y 00 + 4y)h = 0.
1
By the Fundamental Lemma of the Calculus of Variations the associated
Euler-Lagrange equation is 1 FL of C of V
6y 00 + 4y = 0, y(1) = 1, y(2) = 3. 1 E-L equation
Remark: Please comment on, but do not penalise, lack of boundary conditions
given with the Euler-Lagrange equation.
Students who do not derive the E-L equation from the Gâteaux differential
should not receive the final three marks.
page 5 of 10
A (very brief) explanation of h(1) = h(2) = 0 is covered in the course notes in
Section 2.2.1 – students may need this explained further. The Fundamental
Lemma is given in Section 4.3.
Ex. 4.2 illustrates how to derive the Gâteaux differential. 6 Subtotal
(b) We have
Z 1
S[y + h] = y(0) + h(0) + 1
2 dx (2(y 0 + h0 )2 + x2 (y + h)2 ),
0
and so
Z 1
dS
= h(0) + dx (2(y 0 + h0 )h0 + x2 (y + h)h).
d 0
Hence the Gâteaux differential is
Z 1
∆S[y, h] = h(0) + dx (2y 0 h0 + x2 yh)
0
Z 1
= h(0) + 2y 0 (1)h(1) − 2y 0 (0)h(0) + dx (x2 y − 2y 00 )h,
0
after integrating by parts. 1 ∆S[y, h]
Now, the varied path y + h satisfies the boundary condition y(1) = 2 only if
h(1) = 0, and then 1 for h(1) = 0
Z 1
0
∆S[y, h] = (1 − 2y (0))h(0) + dx (x2 y − 2y 00 )h. 2 Gâteaux differential
0
Now consider the subset of variations with h(0) = 0; then the Gâteaux 1 h(0) = 0
differential becomes
Z 1
∆S[y, h] = dx (x2 y − 2y 00 )h.
0
Now, y(x) is a stationary path only if ∆S=0 for all h(x) and using the
Fundamental Lemma this gives
2y 00 − x2 y = 0. (1)
On a path satisfying (1) the Gâteaux differential becomes 1 FL of C of V
∆S[y, h] = (1 − 2y 0 (0))h(0),
and since this is zero for all allowed variations, including those for which
h(0) 6= 0, we must have y 0 (0) = 1/2. 1 h(0) 6= 0
Hence the required Euler-Lagrange equation is 2 final line (inc. bcs)
2y 00 − x2 y = 0, y(1) = 2, y 0 (0) = 21 .
9 Subtotal
Remark: Students who do not attempt to derive the E-L equation from the
Gâteaux differential should not receive the final five marks.
Many students have difficulty understanding why h(1) = 0, and may need
extra explanation here.
Exercise 4.12 and then Exercises 4.22(c) and (d) are good examples to point
students to if they have difficulty moving from the Gâteaux differential to the
E-L equation.
15 Total for Question 3
page 6 of 10
Solution to Question 4 – 16 marks
(a) Using the Taylor expansion
b 2 b2
ln(1 + a + b) = ln(1 + a) + − + O(3 )
1 + a 2(1 + a)2
with a = x2 y 0 and b = x2 h0 gives 3 Taylor expansion
x2 h0 2 x4 h02
ln(1 + x2 (y 0 + h0 )) = ln(1 + x2 y 0 ) + − + O(3 ).
1 + x2 y 0 2(1 + x2 y 0 )2
Hence
2 2
x2 h 0 2 x4 h02
Z Z
∆ = S[y + h] − S[y] = dx − dx 2 ∆
1 1 + x2 y 0 2 1 (1 + x2 y 0 )2
to second order. 5 Subtotal
(b) Integration by parts gives
Z 2 2 Z 2
x2 h0 x2 h x2
d
dx = − dx h .
1 1 + x2 y 0 1 + x2 y 0 1 1 dx 1 + x2 y 0
If h(1) = h(2) = 0 then the boundary terms are zero, and the integral vanishes
if
x2
= c,
1 + x2 y 0
where c is a constant. This last condition rearranges to 2 y 0 (x) = 1
c
− 1
x2
1 1
y 0 (x) = − 2.
c x
Integrating, we obtain y(x) = xc + x1 + d and the boundary conditions give
c = 2/(2A + 1), d = −(2A + 3)/2. Hence 2 particular solution
(2A + 1)x 1 (2A + 3) (2A + 1)x − (2A + 3) 1
y(x) = + − = +
2 x 2 2 x
as required. This derivation is valid only if 1 + x2 y 0 > 0, that is c > 0, ie
A > −1/2. 2 A > −1/2
6 Subtotal
(c) On the stationary path the O() term in ∆ is, by definition, zero. Hence 1 O() zero
2 2 x4 h02
Z
∆ = S[y + h] − S[y] = − dx + O(3 ) < 0 1 ∆ formula
2 1 (1 + x2 y 0 )2
for 6= 0 and || sufficiently small. Hence S[y] has a local maximum on this 1 ∆<0
stationary path. 2 maximum
5 Subtotal
Remark: Students who write that ∆ > 0 and hence there is a local minimum can
score 2 out of the final five marks.
Ex. 2.1 and Ex. 2.3 are relevant here.
16 Total for Question 4
page 7 of 10
Solution to Question 5 – 15 marks
(a) Here we have F = y 02 + ω 2 y 2 + 2y(a sin ωx + b sinh ωx), so Fy0 = 2y 0 and
Fy = 2ω 2 y + 2(a sin ωx + b sinh ωx), and by (4.2) in the course notes the
Euler-Lagrange equation is
y 00 − ω 2 y = a sin ωx + b sinh ωx, y(1) = 0, y(2) = 1. 4 for correct calculation
of the E-L equation
4 Subtotal
(b) Because of the boundary conditions, it is convenient to write the general
solution of the homogeneous equation y 00 − ω 2 y = 0 in the form
yc = α sinh(ω(x − 1)) + β sinh(ω(x − 2)), 1 yc
where α and β are constants. A particular solution of the inhomogeneous
equation y 00 − ω 2 y = a sin ωx + b sinh ωx is
y = p cos ωx + q sin ωx + rx cosh ωx + sx sinh ωx, and substituting this into the
equation gives p = 0, q = −a/(2ω 2 ), r = b/(2ω), s = 0. Hence the general 2 p, q, r, s
solution is
a sin ωx bx cosh ωx
y = α sinh(ω(x − 1)) + β sinh(ω(x − 2)) − + .
2ω 2 2ω
The boundary conditions give where
1 a sin 2ω b cosh 2ω 1 b cosh ω a sin ω
α= 1+ − , β= − . 2 α and β
sinh ω 2ω 2 ω sinh ω 2ω 2ω 2
so that the particular solution is
sinh(ω(x − 1)) a sin 2ω b cosh 2ω sinh(ω(x − 2)) b cosh ω a sin ω
y= 1+ − + −
sinh ω 2ω 2 ω sinh ω 2ω 2ω 2
a sin ωx bx cosh ωx
− + . 1 particular soln.
2ω 2 2ω
6 Subtotal
(c)
Z 2
S[y + h] = dx ((y 0 + h0 )2 + ω 2 (y + h)2 + 2(y + h)(a sin ωx + b sinh ωx)),
1
and on expanding and noting that on the stationary path the term linear in
is, by definition, zero, we obtain
Z 2
S[y + h] = S[y] + 2 dx (h02 + ω 2 h2 ). 2 S[y + h]
1
Since h02 + ω 2 h2 ≥ 0, we have
S[y + h] ≥ S[y] for all || > 0, 2 S[y + h] ≥ S[y]
with equality only if h(x) = 0 for 1 ≤ x ≤ 2.
Hence the functional has a global minimum on the stationary path. 1 minimum
5 Subtotal
Remark: Please comment on, but do not penalise, solutions using exp rather than
hyperbolic functions for the complementary function in (b) – you could point out to
such students that hyperbolic functions in this context will occur often in this
course (and make for a simpler solution in this case). Ex. 3.41 and Ex. 3.46 both
use hyperbolic functions in this way. Likewise please do not penalise solutions that
use the standard basis sinh(ωx) and cosh(ωx) instead of the basis sinh(ω(x − 1)),
sinh(ω(x − 2)). Incidentally you might point out that the two bases are clearly
equivalent, as seen by expanding sinh(ω(x − 1)), sinh(ω(x − 2)) to write the basis
page 8 of 10
sinh(ω(x − 1)), sinh(ω(x − 2)) in terms of the standard basis via an invertible
matrix, i.e.,
sinh(ω(x − 1)) cosh(ω) − sinh(ω) sinh(ωx)
=
sinh(ω(x − 2)) cosh(2ω) − sinh(2ω) cosh(ωx)
Ex. 4.9 is a good example here, for (a)-(c).
15 Total for Question 5
Solution to Question 6 – 15 marks
(a) The budgetary equation is b0 (t) = γb(t) + w − c(t). Hence
Z ∞
U [b] = dt e−βt u(γb(t) + w − b0 (t)) , b(0) = b0 .
0
Hence the Euler–Lagrange equation for U [b] is
d −βt 0
−e u (γb + w − b0 ) − γe−βt u0 (γb + w − b0 ) = 0 .
3 Calculating E-L equation
dt
Rewriting in terms of c gives
d −βt 0
e u (c(t)) + γe−βt u0 (c(t))) = 0 ,
dt
so that
e−βt (γ − β)u0 (c(t)) + e−βt u00 (c(t))c0 (t) = 0 ,
hence
u00 (c)c0 = (β − γ)u0 (c) , 2 DE for c
as required. 5 Subtotal
(b) Now let u(c) = c1−θ /(1 − θ), where 0 < θ < 1 and β 6= (1 − θ)γ. Then, for
c > 0, u0 (c) = c−θ and u00 (c) = −θc−θ−1 so that the Euler–Lagrange equation
becomes
γ−β
c0 = c = κc , c(0) = c0 , 2 Obtaining DE for c
θ
which has solution c(t) = c0 eκt . 1 Solution c
3 Subtotal
(c) The budgetary equation for b is now
b0 (t) = γb(t) + w − c(t) = γb(t) + w − c0 eκt , 1 DE for b
which is a first-order linear differential equation for b(t) solvable in several
ways. Here we use the integrating factor method to write the budgetary
equation as
d −γt
e b = e−γt w − c0 eκt ,
dt
giving, since κ = (γ − β)/θ 6= (γ − (1 − θ)γ)/θ = γ,
−w −γt c0 (κ−γ)t
e−γt b = e − e + α, α constant,
γ κ−γ
and so
w c0 κt
b=− − e + αeγt . 3 GS of DE for b
γ κ−γ
page 9 of 10
Using the initial condition b(0) = b0 , we obtain
w c0 w c0 κt
b = b0 + + eγt − − e . 1 Solution for b
γ κ−γ γ κ−γ
5 Subtotal
(d) Considering
w c0 w c0 (κ−γ)t
e−γt b(t) = b0 + + − e−γt − e ,
γ κ−γ γ κ−γ
we see that limt→∞ e−γt b(t) = −∞ if κ > γ, so the no-Ponzi condition requires,
first, κ < γ (equality has been excluded already) and, second, 1 κ<γ
w c0
lim e−γt b(t) = b0 + + ≥ 0,
t→∞ γ κ−γ
that is
w c0
b0 + ≥ . 1 Second condition
γ γ−κ
2 Subtotal
Remark: This is an adapted question from the 2014J Summer Exam. It is
simplified version of the Ramsey Growth Model, devised by by British
mathematician, economist and philosopher Frank Ramsey (1903 – 1930). Ramsey,
who died very young, also had notable results in combinatorics, in particular, what
is now called Ramsey Theory. Please refer interested students to the St Andrew’s
Mactutor History of Mathematics archive
http://www-history.mcs.st-andrews.ac.uk/Biographies/Ramsey.html
Charles Ponzi (1882–1949) was an infamous swindler who used money from newer
investors to pay older investors (and himself) until the scheme inevitably collapsed.
See https://en.wikipedia.org/wiki/Ponzi scheme
The question is not very difficult although although there is some algebra and the
notation is not standard. So, for example, if needed, please point out to students
that the independent variable is time t, the dependent variable is b(t) so the
Euler-Lagrange equation will need to be adapted. Technicalities have been glossed
over, in particular the validity of the Euler-Lagrange equation on an infinite interval,
and, indeed, the convergence of the functional itself.
15 Total for Question 6
page 10 of 10