#04 (06/25/2025)

Another example of Jacobian

Evaluate
I
1/2

0 

1 −2 y

0 
exp
x

x + 2 y

d x d y.
(1)
Hint:
  1. Draw the integral area.
  2. Change the variables from (x, y) to (u, v) by u = x, v = x + 2y.
    d x d y =
    ∂(x, y)

    ∂(u, v)

    d u d v.
    (2)

Implicit functions

If the relationship between x and y is given implicitly as

f(x, y) = 0,
(3)
it is still possible to express y as a function of x by Taylor series about x = a as

y(x) = y(a) + y′(a)(xa) + y"(a)

2!
(xa)2 + y"′(a)

3!
(xa)3 + …
(4)
if y(a), y′(a), y"(a) … are known. One can differentiate f(x, y) = 0 with respect to x to get y′(x) without explicitly solving f(x, y) = 0 for y(x) as

fx (x, y) + fy(x, y) y′(x) = 0,
(5)
or

y′(x) = − fx(x,y)

fy(x,y)
.
(6)
Once y′(x) is obtained, y"(x) can be derived by differentiating the both sides of y′(x) with respect to x again 1 as

y"(x)
=
(fxx + fxy y′)fyfx (fyx + fyyy′)

fy2
=

fxx + fxy (fx

fy
)
fyfx
fyx + fyy(fx

fy
)

fy2
=
2fx fy fxyfx2 fyyfy2 fxx

fy3
,
(7)
and other higher order derivatives can be obtained in a similar manner.
It is seen that for y = y(x) to exist at x = x0, the denominator of fy must not vanish, i.e.
f

y
(x0, y0) ≠ 0.
(8)

Example

Expand y(x) about x = 1 up to and including second order for
f(x, y) ≡ x yy3 − 1 = 0.
(9)
Solution: The Taylor series of y(x) about x=1 is
y(x) = y(1) + y′(1)(x − 1) + y"(1)/2! (x − 1)2 + …
(10)
By substituting x = 1 into x yy3 − 1 = 0, one gets y(1) = −1.32 … by solving yy3 − 1 = 0 (there are two other complex roots but are not considered here). Next, by differentiation x yy3 − 1 = 0 with respect to x (note that y is a function of x), one gets y + x y′− 3 y2 y′ = 0 which can be solved for y′ as y′ = y/(3 y2x). This can be further differentiated with respect to x as y" = (y′(3y2x) − y(6 y y′−1))/(3 y2x)2 so it is possible to obtain y(1), y′(1), y"(1), ... sequentially. Finally, one obtains

y(x) = −1.32472 −0.310629 (x−1) +0.0170796 (x−1)2+0.00114503 (x−1)3 −0.00128188 (x−1)4+ …
(11)
implicit_diff.jpg

Application:Lagrange multiplier

As an application of the theory of implicit functions, the Lagrange multiplier method is discussed here. We want to extremize f(x, y) subject to the constraint, g(x, y) = 0. Assuming g(x, y) = 0 can be solved for y as y = y(x), this is substituted into the object function of f(x, y) as f(x, y(x)) thus we can look at f(x, y(x)) as a function of x. The candidates of x's to extremize f can be obtained by differentiating f with respect to x as
f′(x) = fx + fy y′ = 0,
(12)
where y′ in Eq.(12) can be obtained from g(x, y) = 0 as
y′ = − gx

gy
.
(13)
Substituting Eq.(13) to Eq.(12) yields

fx

gx
= fy

gy
≡ λ,
(14)
where λ is a newly introduced parameter called the Lagrange multiplier. The development above implies that when extremizing f(x, y) subject to g(x, y) = 0, instead of working on f(x, y), one can try extremizing

f*f(x, y) − λg(x, y),
(15)
without any constraint, i.e. partially differentiating Eq.(15) with respect to x, y and λ as
f*

x
=
fx − λgx = 0,
(16)
f*

y
=
fy − λgy = 0,
(17)
f*

∂λ
=
g = 0.
(18)
The above equations form a set of simultaneous equations for x, y and λ.

Example 1

Find the shortest distance from the origin (0, 0, 0) to the plane, a x + b y + c z = d.

f(x, y, z) = x2 + y2 + z2min
(19)

subject to g(x, y, z) = a x + b y + c zd = 0.
(20)
Instead of minimizing f(x, y, z) with the constraint, one can try minimizing f*(x, y, z) ≡ f(x, y, z) − λg(x, y, z) with respect to x, y, z and λ without any constraint.

f*

x
=
2 x− λa = 0,
(21)
f*

y
=
2 y− λb = 0,
(22)
f*

z
=
2 z− λc = 0,
(23)
f*

∂λ
=
a x + b y + c zd = 0.
(24)
Solving the above set of simultaneous equations yields

x
=
λa

2
(25)
y
=
λb

2
(26)
z
=
λc

2
(27)
λ
=
2 d

a2 + b2 + c2
,
(28)
or equivalently

x
=
ad

a2 + b2 + c2
(29)
y
=
bd

a2 + b2 + c2
(30)
z
=
cd

a2 + b2 + c2
,
(31)
so the minimum distance is


 

x2 + y2 + z2
 
= d




a2 + b2 + c2
.
(32)
Alternative approach: Read the problem as Find the shortest distance from the origin (0, 0, 0) to the plane, a x + b y + c z = d.
lagrange_multi.jpg
The plane, a x + b y + c z = d, is also expressed as

a·x = d,
(33)
where a = (a, b, c) and x = (x, y, z). Equation (33) implies that the vector a is perpendicular to the plane (as was shown in class). Hence, the vector from the origin that minimizes the distance to the plane must be expressed as

x = t a,
(34)
where t is a parameter. By substituting Eq.(34) into Eq.(33), one obtains

a ·ta = t a·a = d.
(35)
Hence, t can be solved as
t = d

a·a
.
(36)
From Eq.(34), it follows
x = d

a·a
a,
(37)
and the length of x is

| x |
=
| d

a·a
a |
=
d

|a|2
|a|
=
d

|a|
=
d



 

a2 + b2 + c2
 
.
(38)

Example 2

Find the shortest distance from (1, 0) to x3 − 2 y2 = 0.
lagrange_1.jpg
(Solution) Let
f* ≡ (x −1)2 + y2 − λ(x3 − 2 y2),
it follows

f*

x
=
2 (x − 1) − 3 x2 λ = 0,
(39)
f*

y
=
2 y + 4 y λ = 0,
(40)
f*

∂λ
=
x3 + 2 y2 = 0.
(41)
The above equations can be solved as (real roots)

(x, y, λ) = ( 2

3
, 2

3 √3
, − 1

2
)    or     ( 2

3
, − 2

3 √3
, − 1

2
),
(42)
both of which yield

d =

 

(x−1)2 + y2
 
=   ⎛


7

27
 
 ∼ 0.509175.
(43)
Sample MATLAB/Octave code:
x=1; y=1; lambda=1;

for i=0:10
 eqs=[ 2*(x-1)-3*x*x*lambda ; 2*y+4 *y *lambda ; -x^3+2*y*y];

 jacob=[2-6*x*lambda, 0, -3*x*x; 0, 2+4*lambda, 4*y; -3*x*x, 4*y, 0];

 right=inv(jacob)*eqs;

 x=x-right(1);
 y=y-right(2);
 lambda=lambda-right(3);
end;

fprintf('%f %f %f\n', x, y,lambda);
fprintf('%f', sqrt((x-1)^2+y^2));

Online C compiler
Online MATLAB/Octave
Wolfram Alpha

Vector Analysis

Scalar product (inner product, dot product)

The scalar product between the two vectors, a and b, is defined as

a·b = a b cos θ,
(44)
where θ is the angle between the two vectors.
innerpro.jpg
The following properties can be derived based on the definition of Eq.(44).
  1. a ·b = b ·a
  2. c a ·b = a ·c b = c (a ·b)
  3. a ·(b + c ) = a ·b + a ·c
It is possible to derive the scalar product in terms of the components of a vector by introducing the base vectors, ex and ey. Note that

ex·ex
=
ey·ey
=
1,
ex·ey
=
ey·ex
=
0.
(45)
Using Eq.(45), the scalar product of two vectors in components is
a·b
=
(ax ex +ay ey )·(bx ex +by ey )
=
ax bx ex ·ex + ax by ex ·ey + ay bx ey ·ex + ay by ey ·ey
=
ax bx + ay by.
(46)
The definition of Eq.(44) is a preferred form as it is independent of the coordinate system.

Vector product (cross product)

The vector product is defined between two vectors in 3-D as

a×bS n,
(47)
where S is the area of the parallelogram spanned by the two vectors and n is the unit vector whose direction is in the right hand system as shown in the figure.
crosspro.jpg
The following properties can be derived based on the definition of Eq.(47).
  1. a ×b = −b ×a
  2. c a ×b = a ×c b = c (a ×b)
  3. a ×(b + c ) = a ×b + a ×c
Note that a×a = 0 (no area by two identical vectors).
The relationship among 3-D base vectors is summarized as

ex×ey
=
ey×ex
=
ez
ey×ez
=
ez×ey
=
ex
ez×ex
=
ex×ez
=
ey,
(48)
and

ex ×ex = ey ×ey = ez ×ez = 0.
(49)
Using the relationship above, the vector product is expressed in components as
a×b
=
(ax ex +ay ey +az ez )×(bx ex +by ey +bz ez )
=
ax bx ex×ex+ax by ex×ey+ax bz ex×ez+ …
=
=




ex
ey
ez
ax
ay
az
bx
by
bz




.
(50)

Equation of plane (application of dot product)

eqplane.jpg
The relationship among x0 (fixed point), x (moving point) and n (normal, fixed vector) is

n ·(xx0) = 0.
(51)
So the equation of a plane is expressed as
n ·x
=
n ·x0
=
c.
(52)
Note that c represents the shortest distance between the plane and the origin.

Triple products

There are two types of vector products, scalar triple product and vector triple product, whose main usage is found in vector analysis.

Scalar triple products, a·(b×c)

a·(b×c) = a·S n = S a cosθ = S h represents the volume of the parallelepiped spanned by the three vectors, a, b and c. Note the cyclic relationship below.
a·(b×c) = b·(c×a) = c·(a×b)
triplepro.jpg

Vector triple products, a ×(b×c)


a ×(b×c) = (a·c)b − (a·b)c.
Note that the right hand side is a combination of b and c both of which are inside the parentheses in the left hand side. The one that is in the middle (b) comes first.
Exercise
  1. a×( b×c) +b×( c×a) +c×( a×b) = ?
  2. (a×b)·(c×d) = ?

Curves, Surfaces and Volumes

If the position vector, R, is expressed by one parameter, u, a set of all the points of R varying u forms a curved line. If R is expressed by two parameters, u and v, as R(u,v), a set of all the points of R by varying both u and v forms a curves surface. (obvious statement for R(u,v,w)).

Arc length

linelength.jpg
The length of a curved line from u = u to u = u + du can be computed by carrying out integration of ds (line segment)

dR
=
R(u + d u ) − R(u)
=
R(u) + d R

du
du + …− R(u)
 ∼ 
dR

d u
du
=
eu d u,
(53)
where
eu dR

d u
.
Therefore,

ds
=


 

dR ·dR
 
=


 

eu d u ·eu d u
 
=


 

eu ·eu
 
d u.
(54)
and

s =
u=u1

u=u0 


 

eu ·eu
 
d u.
(55)
Example Compute the length of y = x2 from x = 0 to x = 1.
lengthexample.jpg
Solution As
R =



x
y
z




=



u
u2
0




,
it follows

eu =



1
2u
0




,
and

ds =

 

eu ·eu
 
d u =

 

1 + 4 u2
 
du,
so

s =
1

0 


 

1 + 4 u2
 
du
Let the computer carry out this integral.
Enter the following
Sqrt[1 + 4 u^2] u 0 1

exactly (case sensitive, square bracket) in the boxes then press the query button.
Integrate with respect to
from to .

Surface area element

surfacearea.jpg
To obtain the surface area expressed by two parameters, u and v, one can first compute the surface element spanned by the two vectors shown above:

R(u + d u, v)− R(u, v)
=
R(u, v) + R

u
duR(u, v)
=
eu du,
(56)
R(u, v + dv) − R(u, v)
=
R(u, v) + R

v
dvR(u, v)
=
ev dv,
(57)
where
eu
R

u
,
(58)
ev
R

v
.
(59)
Remembering that the area of a parallelogram spanned by two vectors, a and b, is

ds
=
  ⎛
 ⎥


det


eu ·eu ,
eu ·ev
ev ·eu ,
ev ·ev



 
du dv
=


 

E FG2
 
du dv.
(60)
where
E
=
eu ·eu
F
=
ev ·ev
G
=
eu ·ev.
Alternatively, recall that the magnitude of a ×b is the area of the parallegram spanned by a and b, Equation (60) can be also written as

d s = | eu ×ev | du dv.

Example of surface integral

As an example of surface integrals, we attempt to compute the surface area of a sphere x2 + y2 + z2 = a2. By setting x = u and y = v, a position vector on the sphere is expressed as

R(u, v) =




u
v


 

a2u2v2
 





,
(61)
so
eu
=






1
0
u



 
[ˉ(a2u2v2)]






(62)
ev
=






0
1
v



 
[ˉ(a2u2v2)]






(63)
and

eu ·eu
=
1+ u2

a2u2v2
ev ·ev
=
1+ v2

a2u2v2
eu ·ev
=
uv

a2u2v2
.
(64)
Hence,

dS
=


 

(eu ·eu) (ev ·ev) − (eu ·ev)2
 
du dv
=
a




a2u2v2
du dv.
(65)
The surface area of a semi-sphere (radius = a) is

S
=


a du dv




a2u2v2
=
a

r dr dθ




a2r2
2
=
a
a

0 
r dr




a2r2



0 
1 dθ
=
a
a

0 
r dr




a2r2
3
=
a2.
(66)
Alternative approach
spherical.jpg
A bit faster approach than the one above is to use the spherical coordinate system. Noting that the equation, x2 + y2 + z2 = a2 is automatically satisfied if

x
=
a sin ϕcos θ,
y
=
a sin ϕsin θ,
z
=
a cos ϕ.
(67)
Hence we can set
R =



a sin ϕcos θ
a sin ϕsin θ
a cos ϕ,




.
(68)
It follows
eϕ
=




a cos ϕcos θ
a cos ϕsin θ
a sin ϕ




(69)
eθ
=




a sin ϕsin θ
a sin ϕcos θ
0




,
(70)
and
E
=
a2
(71)
F
=
a2 sin 2 ϕ
(72)
G
=
0
(73)
dS
=


 

EFG2
 
dθdϕ
(74)
=
a2 sin ϕdθdϕ,
(75)
thus
S
=

π/2

0 



0 
a2 sin ϕdθdϕ
=
a2
π/2

0 
sin ϕdϕ
=
a2.
(76)

z = f(x, y)

If the equation of a curved surface is given as
z = f(x, y),
(77)
the area element can be expressed as
d S =

 

1 + fx2 + fy2
 
dx dy,
(78)
where
fx
f

x
,
fy
f

y
.
(79)
Proof

ex
=
R

x
=




1
0
fx




ey
=
R

y
=




0
1
fy




,
E
=
ex ·ex
=
1 + fx2,
F
=
ey ·ey
=
1 + fy2,
G
=
ex ·ey
=
fx fy,
EFG2
=
(1 + fx2)(1 + fy2) − (fx fy)2
=
1 + fx2 + fy2.
(80)

Volume

volumeelement.jpg
The volume element of the parallelepiped spanned by the three vectors above can be expressed as4

dv
=
  ⎛
 ⎥
 ⎥






eu ·eu, eu ·ev, eu ·ew
ev ·eu, ev ·ev, ev ·ew
ew ·eu, ew ·ev, ew ·ew




 
du dv dw
=
|eu·(ev×ew)| du dv dw.
(81)
Example: Volume of sphere
spherical2.jpg

R =



x
y
z




=



r sin ϕcos θ
r sin ϕsin θ
r cos ϕ




,
(82)
so

er =



sinϕ cos θ
sinϕ sin θ
cos ϕ




,   eϕ =



r cosϕ cos θ
r cosϕ sin θ
r sin ϕ




,   eθ =



r sin ϕ sin θ
r sin ϕ cos θ
0




(83)
Noting that
eϕ ×eθ =



r2  sin2 ϕ cos θ
r2  sin2 ϕ sin θ
r2  sin ϕ cos ϕ




(84)
it follows
er ·eϕ ×eθ = r2 sin ϕ.
(85)
so
V
=



dV
=



0 

π

0 

a

0 
r2 sin ϕdr dϕdθ
=



0 
dθ
π

0 
sin ϕdϕ
a

0 
r2 dr
=
a3

3
.
(86)

Summary

  1. Length of Arc

    dl
    =


     

    eu ·eu
     
    du
    =
    |eu | du.
  2. Area

    d s
    =
      ⎛
     ⎥


    |
    eu ·eu,
    eu ·ev
    eu ·ev,
    ev ·ev
    |
     
    du dv
    =
    |eu ×ev| du dv.
  3. Volume

    d v
    =
      ⎛
     ⎥
     ⎥






    eu ·eu,
    eu ·ev,
    eu ·ew
    ev ·eu,
    ev ·ev,
    ev ·ew
    ew ·eu,
    ew ·ev,
    ew ·ew




     
    du dv dw
    =
    |eu ·(ev ×ew) | du dv dw.


Footnotes:

1

u

v



 
= uvu v

v2
.
2
u = r cos θ,     v = r sin θ,     du dv = r dr dθ.
(87)
3 Let
a2r2t,
(88)
then − 2 r dr = dt and as r → 0, ta2 and as ra, t → 0 so that

a

0 
r dr




a2r2
=
0

a2 
r

t
dt

(− 2 r)
= 1

2

a2

0 
dt

t
= a.
(89)
4 Let a=(a1, a2, a3), b=(b1, b2, b3), c=(c1, c2, c3).
a·(b×c) = (−a3 b2 + a2 b3) c1 + (a3 b1a1 b3) c2 + (−a2 b1 + a1 b2) c3 =



a1
a2
a3
b1
b2
b3
c 1
c2
c3




.
On the other hand,




(a, a)
(a, b)
(a, c)
(b, a)
(b, b)
(b, b)
(b, a)
(b, b)
(b, b)




=(−a3 b2 c1 + a2 b3 c1 + a3 b1 c2a1 b3 c2a2 b1 c3 + a1 b2 c3)2 =



a1
a2
a3
b1
b2
b3
c 1
c2
c3




2





 
.



File translated from TEX by TTH, version 4.03.
On 22 Jun 2025, 17:35.