Example 1

To calculate the line integral
∫
C
2+
2
x
ys
where
C
is the part of the unit circle
2
x
+
2
y
1
for
y≥0
, we first parameterize the curve
C
.​The parameterization of the unit circle for
y≥0
(upper semicircle) is as follows:
​
​
xcos(t), ysin(t), 0≤t≤π
​
The differential arc length
ds
is given by:
​​
ds
2
dx
dt
+
2
dy
dt
t
2
cos
(t)+
2
sin
(t)
tdt
​
​
Thus, the line integral becomes:
​​
∫
C
2+
2
x
ys
π
∫
0
(2+
2
cos
(t)sin(t))t
​
This integral can be split into two parts:
​​
π
∫
0
2t+
π
∫
0
2
cos
(t)sin(t)t
​
​
The first part is easy to calculate:
​​
π
∫
0
2t2t
π
|
0
2π
​
For the second part, we use the integration by substitution technique. Let
ucos(t)
, so
du-sin(t)t
or
sin(t)t-du
:
​​
π
∫
0
2
cos
(t)sin(t)t-
-1
∫
1
2
u
u
​
​
Calculating the integral:
-
-1
∫
1
2
u
u
1
∫
-1
2
u
u
1

3
u
3

-1

3
1
3
-
3
(-1)
3

2
3
​
​
Combining the two parts, we get:
​​
π
∫
0
(2+
2
cos
(t)sin(t))t2π+
2
3
​​Therefore, the result of the line integral is
2π+
2
3
.
In[]:=
(*ParameterizationofthecurveC*)x[t_]:=Cos[t]​​y[t_]:=Sin[t]​​​​(*Functiontointegrate*)​​f[t_]:=2+x[t]^2*y[t]​​​​(*LineintegraloverC*)​​integral=Integrate[f[t],{t,0,Pi}]​​​​(*Plotthefunctionovertheinterval[0,Pi]*)​​plot=Plot[f[t],{t,0,Pi},PlotLabel->"Function 2 + x^2y along C",AxesLabel->{"t","f(t)"},PlotTheme->"Scientific"]​​
Out[]=
2
3
+2π
Out[]=
In[]:=
ParametricPlot3D[{Cos[t],Sin[t],2+Cos[t]^2*Sin[t]},{t,0,Pi},PlotRange->All,AxesLabel->{"x","y","z"},PlotLabel->"Surface above unit circle"]​​​​
Out[]=

Example 2

To calculate the surface integral
∫
S
2
x
S
where
S
is the surface of the sphere
2
x
+
2
y
+
2
z
4
, we follow these steps:​​1. Convert to spherical coordinates:​ -
xrsin(θ)cos(ϕ)
-
yrsin(θ)sin(ϕ)
-
zrcos(θ)
​For the sphere
2
x
+
2
y
+
2
z
4
, the radius is
r2
.​Therefore,
2
x

2
(2sin(θ)cos(ϕ))
4
2
sin
(θ)
2
cos
(ϕ)
.​​2. Determine the surface element
dS
: Since
dS
2
r
sin(θ)dθdϕ
, for \(
r2
we have
dS4sin(θ)dθdϕ
.​​3. Compute the surface integral:​​
∫
S
2
x
S
2π
∫
0
π
∫
0
4
2
sin
(θ)
2
cos
(ϕ)·4sin(θ)θϕ
​​​
16
2π
∫
0
2
cos
(ϕ)ϕ
π
∫
0
3
sin
(θ)θ
​ ​ - The integral over
ϕ
is
2π
∫
0
2
cos
(ϕ)ϕπ
. - The integral over
θ
is
π
∫
0
3
sin
(θ)θ
4
3
.​Multiplying the results of the integrals by the factor 16 , we get:​​
∫
S
2
x
S16·π·
4
3

64π
3
​​​Thus, the surface integral
∫
S
2
x
S
over the surface of the sphere
2
x
+
2
y
+
2
z
4
is
64π
3
.
In[]:=
(*Definesphericalcoordinates*)x[r_,θ_,φ_]:=rSin[θ]Cos[φ]​​y[r_,θ_,φ_]:=rSin[θ]Sin[φ]​​z[r_,θ_,φ_]:=rCos[θ]​​​​(*Definethefunctionforx^2*)​​f[r_,θ_,φ_]:=x[r,θ,φ]^2​​​​(*Computethedifferentialsurfaceelementinsphericalcoordinates*)​​dS[r_,θ_,φ_]:=r^2Sin[θ]​​​​(*Performthesurfaceintegralcomputationinsphericalcoordinates*)​​r=2;(*Theradiusofthesphere*)​​surfaceIntegral=Integrate[f[r,θ,φ]dS[r,θ,φ],{φ,0,2π},{θ,0,π}]​​​​(*Displaytheresultofthesurfaceintegral*)​​Print["The surface integral is: ",surfaceIntegral]​​​​(*Generatetheplotofthespherewithradiusr=2*)​​SphericalPlot3D[r,{θ,0,π},{φ,0,2π},PlotStyle->Directive[Opacity[0.5],Blue],Mesh->None,PlotPoints->50,PlotLegends->Placed[{"r = 2"},{0.8,0.8}]]​​

Example 3

Using the definition of the line integral :

​
Calculating the integral for each segment:
​
​
Adding the integrals from all the segments to get the total line integral.
​
Overall, the line integral is:
or

Apply Green' s Theorem for the line integral

​
​
So, the double integral becomes: