{NotebookFileName[],DateString[]}

style[
t_
]:=
Style[t,Bold,FontFamily->"Arial",FontSize->14]

$Assumptions={{x,y}∈Reals}

Mobius lesson

∫(2^x)\[DifferentialD]x

(∫_0^1)(2^x)\[DifferentialD]x

(∫_1^2)(-20(E^(-t)))\[DifferentialD]t

(∫_1^2)(-20(E^(-t)))\[DifferentialD]t//N

∫(x/(Sqrt[1+(x^2)]))\[DifferentialD]x

Plot[(x/(Sqrt[1+(x^2)])),{x,-1,1}
]

Plot[(1/(Sqrt[1+(x^2)])),{x,-10,10}
]

1+(x^2)/.x->(1/2)(t-(1/t))

1+(x^2)/.x->(1/2)(t-(1/t))//Expand

1+(x^2)/.x->(1/2)(t-(1/t))//Simplify

D[(1/2)(t-(1/t)),t]

∫(1/(Sqrt[1+(x^2)]))\[DifferentialD]x

∫Exp[-(1/(x^2))]\[DifferentialD]x

A couple examples

(∫_1^2)x\[DifferentialD]x

∫(a (x^2)+b x+c)\[DifferentialD]x

(∫_(-1)^1)(a (x^2)+b x+c)\[DifferentialD]x

a1[
t_
]:=
100 (2^(-t/1000))

∫a1[t]\[DifferentialD]t

∫a (2^(-t/th))\[DifferentialD]t

32*3125

∫Tan[x]\[DifferentialD]x

Net change example

v1[
t_
]:=
10(E^(-t/3))

∫v1[t]\[DifferentialD]t

(∫_0^6)v1[t]\[DifferentialD]t

int1=(∫_0^6)v1[t]\[DifferentialD]t//N

mean1=(int1/(6-0))

tmean1=t/.Solve[v1[t]==mean1,t][[1]]

Plot[{
v1[t],
mean1
},{t,0,6}
,PlotRange->{All,{0,All}}
,PlotLegends->style/@{"v(t)","mean v"}
,Filling->Axis
,Epilog->{
PointSize[Large],
Point[{{tmean1,mean1}}],
Text[style["t = "<>ToString[tmean1]],{tmean1,mean1},{-1,-1}]
}
]

Linear substitutions

∫Cos[ω t+ϕ]\[DifferentialD]t//Simplify

(∫_a^b)Cos[ω t+ϕ]\[DifferentialD]t//Simplify

∫(E^(-λ x))\[DifferentialD]x

∫(x^(-1/2))\[DifferentialD]x

∫(1/(Sqrt[a x+b]))\[DifferentialD]x

(∫_0^(b/a))(1/(Sqrt[a x+b]))\[DifferentialD]x

Less trivial substitutions

∫(Sqrt[4-(x^2)])\[DifferentialD]x

D[ArcSin[x],x]

D[x(Sqrt[4-(x^2)]),x]

∫(Sqrt[1-(x^2)])\[DifferentialD]x

D[x(Sqrt[1-(x^2)]),x]

D[x(Sqrt[1-(x^2)]),x]//Simplify

D[ArcSin[x],x]

Suppose I try the substitution x=sinθ, dx=cos θdθ in ∫(Sqrt[1-(x^2)])dx. (Assume x∈[-1,1], so that (Sqrt[1-(x^2)])=(Sqrt[1-(sin^2)θ])=+cos θ. Then I get

∫(Sqrt[1-(x^2)])dx=∫((cos )^2)θdθ

∫((Cos[θ])^2)\[DifferentialD]θ

∫4((Cos[θ])^2)\[DifferentialD]θ//Simplify

((Cos[θ])^2)==((Cos[2θ]+1)/2)//Simplify

OK, so that works. The (1/2) gives me (θ/2), which leads to the arcsin, and the ((cos(2θ))/2) leads to ((sin(2θ))/4). Using sin(2θ)=2sin θ cos θ that becomes (1/2)x(Sqrt[1-(x^2)]), which is my other term.

∫Tan[θ]\[DifferentialD]θ

∫((Sin[θ])^3)\[DifferentialD]θ

∫((Sin[θ])^3)\[DifferentialD]θ//TrigExpand

D[(1/3)((Cos[θ])^3)-Cos[θ],θ]

D[(1/3)((Cos[θ])^3)-Cos[θ],θ]//Simplify

∫((Sin[θ])^3)\[DifferentialD]θ==(1/3)((Cos[θ])^3)-Cos[θ]//Simplify

((Sin[θ])^2)==((1-Cos[2θ])/2)//Simplify

((Cos[θ])^2)==((1+Cos[2θ])/2)//Simplify

Volume of a sphere

Treat the sphere as a stack of disks of thickness dz. z will run from -R to R. The radius of the disk at z is, by the Pythagorean theorem, r=(Sqrt[(R^2)-(z^2)]). The area is π (r^2)=π((R^2)-(z^2)).

$Assumptions=Union[$Assumptions,{r>0,z>0,R>0}]

(∫_(-R)^R)π((R^2)-(z^2))\[DifferentialD]z

Block[{is=400,R=1,z=-0.5,dz=0.05,r},
r=(Sqrt[(R^2)-(z^2)]);
Graphics3D[{
{Opacity[0.2],
Sphere[{0,0,0},R],
Cylinder[{{0,0,z},{0,0,z+dz}},r]
},
{
Thickness[Scaled[0.01]],Opacity[1],Black,
Arrow[{{0,0,z},{0,r,z+dz}}],
Arrow[{{0,0,0},{0,0,z}}],
Text[style["z"],{0,0,z/2},{2,0}],
Text[style["r=(Sqrt[(R^2)-(z^2)])"],{0,r/2,z+dz},{-1.1,0}],
Text[style["radius R sphere"],{0,0,R}],
Text[style["radius r height dz cylinder at z"],{0,-r/2,z},{-0.2,0}]
}
}
,ImageSize->400
,Boxed->False
]
]

Area of a sphere

∫2π (R^2) Sin[φ]\[DifferentialD]φ

(∫_0^π)2π (R^2) Sin[φ]\[DifferentialD]φ

A circular shell at z of thickness dz has what surface area? the radius of the circle is easy: it is r=(Sqrt[(R^2)-(z^2)]). The perpendicular stretch is (Sqrt[(((dr))^2)+(((dz))^2)]). I can easily get dr by differentiating r=(Sqrt[(R^2)-(z^2)]).

D[(Sqrt[(R^2)-(z^2)]),z]

dr=-(z/r)dz. (Sqrt[(dr)+(((dz))^2)])=(Sqrt[(((z^2)/(r^2))+1)(((dz))^2)])=(Sqrt[((z^2)/(r^2))+1])dz=(1/r)(Sqrt[(z^2)+(r^2)])dz=(R/r)dz.

Block[{r=(Sqrt[(R^2)-(z^2)])},
{
(∫_(-R)^R)2π r(Sqrt[((z^2)/(r^2))+1])\[DifferentialD]z,
∫2π r(Sqrt[((z^2)/(r^2))+1])\[DifferentialD]z,
(Sqrt[((z^2)/(r^2))+1]),
2π r(Sqrt[((z^2)/(r^2))+1])
}
]//Simplify

Rats. Well, that turns out too simple to be interesting. Seems that the area of the shell from z to z+dz is just proportional to dz and independent of z. This might be an easy way to do the gravity integral.

Block[{z0=-.5,dz=0.05},
ContourPlot3D[(x^2)+(y^2)+(z^2)==1,{x,-1,1},{y,-1,1},{z,z0,z0+dz}
,PlotRange->{{-1,1},{-1,1},{-1,1}}
]
]

Block[{is=400,R=1,z0=0.7,dz=0.05,r},
r=(Sqrt[(R^2)-(z0^2)]);
Show[
Graphics3D[{
{Opacity[0.2],
Sphere[{0,0,0},R]
},
{
Thickness[Scaled[0.01]],Opacity[1],Black,
Arrow[{{0,0,z0},{0,r,z0+dz}}],
Arrow[{{0,0,0},{0,0,z0}}],
Text[style["z"],{0,0,z0/2},{2,0}],
Text[style["r=(Sqrt[(R^2)-(z^2)])"],{0,r/2,z0+dz},{-1.1,0}],
Text[style["radius R sphere"],{0,0,-R}],
Text[style["radius r height dz surface element at z"],{0,-r,z0},{-0.3,1.5}]
}
}
,ImageSize->400
,Boxed->False
],
ContourPlot3D[(x^2)+(y^2)+(z^2)==1,{x,-1,1},{y,-1,1},{z,z0,z0+dz}
,PlotRange->{{-1,1},{-1,1},{-1,1}}
]
]
]

The circumference is a little more interesting. It works out to be

Block[{r=(Sqrt[(R^2)-(z^2)])},
{
(R/r),
∫(R/r)\[DifferentialD]z,
(∫_(-R)^R)(R/r)\[DifferentialD]z
}
]//Simplify

How do I integrate ((dz)/(Sqrt[1-(z^2)]))? Let z=sin θ, dz=cos θdθ. Then I get ∫dθ, which gives me θ. Kind of odd thatI’m getting an arctan—shouldn’t it be arcsin?

∫(1/(Sqrt[1-(z^2)]))\[DifferentialD]z

Yes. All right, I can use that.

Block[{R=1,z0=0.5,dz=0.05,φ0,dφ,r,dr,p1,p2},
r=(Sqrt[(R^2)-(z0^2)]);
dr=(Sqrt[(R^2)-(((z0+dz))^2)])-r;
φ0=ArcSin[(z0/R)];
dφ=ArcSin[((z0+dz)/R)]-φ0;
p1={r,z0};
p2={r+dr,z0+dz};
Graphics[{
{
Thick,Black,Circle[{0,0},R,{φ0,φ0+dφ}],
Text[style["ds"],((p1+p2)/2),{1,0.5}]
},
{Pink,Circle[{0,0},R,{0,(π/2)}]},
Arrow[{{0,0},p1}],Arrow[{{0,0},p2}],
{
Line[{p1,{r,z0+dz}}],
Text[style["dy"],{r,z0+(dz/2)},{-1.2,0}],
Line[{{r,z0+dz},p2}],
Text[style["dx"],{r+(dr/2),z0+dz},{0,-1}],
}
}
,PlotRange->{{0,1},{0,1}}
]
]

Block[{R=1,z0=0.5,dz=0.05,φ0,dφ,r,dr,p1,p2},
r=(Sqrt[(R^2)-(z0^2)]);
dr=(Sqrt[(R^2)-(((z0+dz))^2)])-r;
φ0=ArcSin[(z0/R)];
dφ=ArcSin[((z0+dz)/R)]-φ0;
p1={r,z0};
p2={r+dr,z0+dz};
Graphics[{
{
Thick,Black,Circle[{0,0},R,{φ0,φ0+dφ}],
Text[style["ds"],((p1+p2)/2),{1,0.5}]
},
{Pink,Circle[{0,0},R,{0,(π/2)}]},
Arrow[{{0,0},p1}],Arrow[{{0,0},p2}],
{
Line[{p1,{r,z0+dz}}],
Text[style["dy"],{r,z0+(dz/2)},{-1.2,0}],
Line[{{r,z0+dz},p2}],
Text[style["dx"],{r+(dr/2),z0+dz},{0,-1}],
}
}
,PlotRange->{{r-0.5dr,r+1.5dr},{z0-0.5dz,z0+1.5dz}}
]
]

(x^2)+((r(x))^2)=(R^2)
2x+2r(x)r'(x)=0
((dr)/(dx))=-(x/r)

(((ds))^2)=(((dx))^2)+(((dr))^2)
=(((dx))^2)+((x^2)/(r^2))(((dx))^2)
ds=(Sqrt[1+((x^2)/(r^2))])dx
=(Sqrt[(((r^2)+(x^2))/(r^2))])dx
=(R/r)dx

So the integral for the circumference is (∫_(x=-R)^R)ds=(∫_(x=-R)^R)(R/(r(x)))dx=(∫_(-R)^R)(R/(Sqrt[(R^2)-(x^2)]))dx. Now let x=R sinθ, dx=R cos θdθ. If sin θ∈[-1,1], θ∈[-(π/2),(π/2)], then cos θ>0, so (Sqrt[(R^2)-(x^2)])=(Sqrt[(R^2)-(R^2)(sin^2)θ])=R cos θ. And I have

(∫_(x=-R)^R)ds=(∫_(-(π/2))^(π/2))(R/(R cos θ))cos θ dθ=(∫_(-(π/2))^(π/2))Rdθ=Rθ(Subscript[|, -(π/2)]^(π/2))=R π

Circular arc

This is just what I did above, with some nicer pictures

c1[
x_
]:=
(Sqrt[1-(x^2)])

Block[{x1=-0.3,x2=0.9},
Show[
Plot[c1[x],{x,-1,1}
,PlotLegends->style/@{"y = (Sqrt[1-(x^2)])"}
,Epilog->{
Text[style["a"],{x1,0},{0,-1}],
Text[style["b"],{x2,0},{0,-1}],
{
Dashed,
Line[{{x1,0},{x1,c1[x1]}}],
Line[{{x2,0},{x2,c1[x2]}}]
}
}
],
Plot[c1[x],{x,x1,x2}
,PlotStyle->Directive[Thickness[0.02],Black]
,PlotLegends->style/@{"arc from a to b"}
]
]
]

Gravity due to a sphere

Suppose you have a ring (a circle with no thickness) of radius r and mass m. What gravitational force does it exert on an object on its axis at a distance ρ from its center? The force will obviously be along the axis and towards the center of the ring, so I only need compute the axial component of the force. The force due to an angle element dθ will be F=-M((mdθ)/(2π))(G/((r^2)+(ρ^2))), but this is towards the element. Its axial and perpendicular components are ((F ρ)/((r^2)+(ρ^2))) and ((F r)/((r^2)+(ρ^2))). I only need the first. The force of the whole ring is that multiplied by ((2π)/(dθ)), or -G M m((ρ/(Sqrt[(r^2)+(ρ^2)])))((1/((r^2)+(ρ^2)))).

Now, suppose this ring belongs to a spherical shell. The radius of the shell is R, and its center is at distance x from the object. Then, for φ from 0 to π, there is a ring of radius R sin φ and mass m∝sin φ and ρ=x-R cos φ.

$Assumptions=Union[$Assumptions,{r>0,R>0,ρ>0,x>0,x>R,s>R,s>ρ}]

Block[{ρ=x-R Cos[φ],r=R Sin[φ]},
{
(r^2)+(ρ^2),
(1/((r^2)+(ρ^2))),
(ρ/((r^2)+(ρ^2))),
(ρ/((((r^2)+(ρ^2)))^2)),
((ρ Sin[φ])/((((r^2)+(ρ^2)))^(3/2)))
}//FullSimplify
]

Block[{ρ=x-R Cos[φ],r=R Sin[φ]},
{
((ρ Sin[φ])/((((r^2)+(ρ^2)))^(3/2)))//Simplify,
∫((ρ Sin[φ])/((((r^2)+(ρ^2)))^(3/2)))\[DifferentialD]φ//Simplify,
(∫_0^π)((ρ Sin[φ])/((((r^2)+(ρ^2)))^(3/2)))\[DifferentialD]φ//Simplify
}
]

Hurray! It works—gives me an inverse square force. But this looks like way too complex a thing to use in MATH 127.

OK, I see. It’s not actually so bad. First, I can substitute y(φ)= cos φ. I have a convenient sin φ to absorb the derivative, so I get

((x-r y[φ])/((((x^2)+(R^2)-2R x y[φ]))^(3/2)))D[y[φ],φ]/.y->Cos

That is the negative of my integrand. If φ goes from 0 to π, cos φ goes from 1 to -1. So I end up with

(∫_0^π)(((x-R cos φ)sin φ)/((((R^2)+(x^2)-2R x cos φ))^(3/2)))dφ=-(∫_1^(-1))((x-R y)/(((R^2)+(x^2)-2R x y)))dy

(∫_0^π)(((x-R Cos[φ])Sin[φ])/((((R^2)+(x^2)-2R x Cos[φ]))^(3/2)))\[DifferentialD]φ==-(∫_1^(-1))((x-R y)/( ((((R^2)+(x^2)-2R x y))^(3/2))))\[DifferentialD]y

{
∫((x-R y)/((((R^2)+(x^2)-2R x y))^(3/2)))\[DifferentialD]y,
∫(x/((((R^2)+(x^2)-2R x y))^(3/2)))\[DifferentialD]y,
∫((-R y)/((((R^2)+(x^2)-2R x y))^(3/2)))\[DifferentialD]y
}

Why does that work? OK, the x in the numerator is easy because when I differentiate (R^2)+(x^2)-2R x y with respect to y I get 2R x, which pops out the x in the numerator. What’s going on with the -R y? Looks like it may be a parts integration, with dv=((((R^2)+(x^2)-2R x y))^(-3/2))dy, u=-R y.

v1=∫((((R^2)+(x^2)-2R x y))^(-3/2))\[DifferentialD]y

u1=-R y

v1 D[u1,y]

v1 u1-∫v1 D[u1,y]\[DifferentialD]y

v1 u1-∫v1 D[u1,y]\[DifferentialD]y//Simplify

Yup, that does it.

OK, maybe I can use this as my crowning example.

Let’s try working it out with shells of height dz. FRom my calculations above, I know that the mass of such a shell is proportional to dz and independent of z. The radius of the ring is r=(Sqrt[(R^2)-(z^2)]). The nonvector total force is proportional to ((dz)/((r^2)+(((x-z))^2))). The axial component of that force is ((x-z)/(((r^2)+(((x-z))^2))(Sqrt[(((x-z))^2)+(r^2)])))=((x-z)/((((r^2)+(((x-z))^2)))^(3/2))). (((x-z))^2)+(r^2)=(x^2)-2x z+(z^2)+(r^2)=(x^2)-2x z+(R^2).

(∫_(-R)^R)((x-z)/((((x^2)-2x z+(R^2)))^(3/2)))\[DifferentialD]z

Now, that is actual a fairly simple integral, since x-z∝(∂_x)((x^2)-2x z+(R^2)).

A magic substitution

I=∫((dx)/(Sqrt[1+(x^2)]))

Now, make the substitution x=(1/2)(t-(1/t))

u2[
t_
]:=
(1/2)(t-(1/t))

(x^2)+1/.x->u2[t]

(x^2)+1/.x->u2[t]//Expand

(((t+(1/t)))^2)//Expand

((x^2)+1/.x->u2[t])==((((t/2)+(1/(2t))))^2)//Simplify

u2'[t]

dx=(1/2)(1+(1/(t^2)))dt

I=∫(1/((1/2)(t+(1/t))))((1/2)(1+(1/(t^2))))dt

$Assumptions=Union[$Assumptions,{t∈Reals}]

(1/(Sqrt[1+(x^2)]))/.x->u2[t]//Simplify

(1/(Sqrt[1+(x^2)]))u2'[t]/.x->u2[t]//Simplify

((Abs[t])/(t^2))==(1/(Abs[t]))//Simplify

Solve[x==u2[t],t]

∫((\[DifferentialD]t)/(Abs[t]))

D[Log[Abs[t]],t]//FullSimplify

Plot[x+(Sqrt[(x^2)+1]),{x,-20,20}
]