Examples of the surface area and the volume

The surface area of the fortune cookie

We use the standard formula for the surface area.

D[{Cos[t], Cos[t+s],s},t]

D[{Cos[t], Cos[t+s],s},s]

?Cross

Cross[D[{Cos[t], Cos[t+s],s},s],D[{Cos[t], Cos[t+s],s},t]]

The square of the norm of the cross product is:

FullSimplify[{-Sin[s+t],Sin[t],Sin[t] Sin[s+t]}.{-Sin[s+t],Sin[t],Sin[t] Sin[s+t]}]

Integrate[(Sqrt[((Sin[t])^2)+(1+((Sin[t])^2)) ((Sin[s+t])^2)]),{t,0,2Pi},{s,0,Pi}]

It appears that Mathematica can not be calculate the above integral exactly.

NIntegrate[(Sqrt[((Sin[t])^2)+(1+((Sin[t])^2)) ((Sin[s+t])^2)]),{t,0,2Pi},{s,0,Pi}]

Options[NIntegrate]

The volume

Thera are two ways to calculate the volume. First calculate the area of each horizontal slice and then integrate those values.

Manipulate[ParametricPlot[{Cos[-t], Cos[-t+s]},{t,0,2 π},PlotPoints->{61,91},Mesh->None,PlotRange->{{-1.5`,1.5`},{-1.5`,1.5`}},Axes->True,Epilog->{{PointSize[0.02],Point[{Cos[-tt], Cos[-tt+s]}]}}],{s,0,π},{tt,0,2 Pi}]

To find the area we use Green’s theorem. We use F = x j and calculate the circulation

{Cos[t], Cos[t+s]}

Integrate[-Integrate[{0,Cos[t]}.D[{Cos[t], Cos[t+s]},t],{t,0,2 Pi}],{s,0, Pi}]

The other way is to use the divergence theorem.

Volume (try F = x i)

Integrate[Integrate[{Cos[t], 0,0}.{Sin[s+t],-Sin[t],-Sin[t] Sin[s+t]},{t,0,2 Pi}],{s,0,Pi}]

Conditions in integration

Mathematica can not calculate the following integral.

Integrate[Abs[a+ Cos[t]],{t,0,2 Pi}]

However,  this integral is not too difficult. We could do it by hand.

Manipulate[Plot[{Abs[a+ Cos[t]],Abs[a]},{t,0,2Pi},PlotRange->{0,5},Ticks->{Range[0,2 Pi,(Pi/4)],Range[0,5,.5]}],{a,-3,3}]

From the plot above we see that the function is symmetric with respect to the line x=π. So, it is enough to consider the interval [0,π]. Furher, the integral is trivial when a≥1 or a≤-1; it is just |a| π.  When -1 < a < 1 we need to integrate separately over the interval [0, ArcCos[-a]] and [ArcCos[-a],π].

Integrate[a+ Cos[t],{t,0,ArcCos[-a]}]+Integrate[-a- Cos[t],{t,ArcCos[-a],Pi}]

The integrals above are doable by hand.  Finally, this is the graph of the integral as as a function of  a.

Plot[If[Abs[a]>1,Abs[a] Pi,2 (Sqrt[1-(a^2)])-a π+2 a ArcCos[-a]],{a,-3,3},PlotRange->{0,10}]

Interestingly, Mathematica evaluates the integral with a help of extra information about a.

Integrate[Abs[a+ Cos[t]],{t,0,Pi},Assumptions-> And[a>0,a<1]]

Integrate[Abs[a+ Cos[t]],{t,0,2 Pi},Assumptions-> (a>1)]

Integrate[Abs[a+ Cos[t]],{t,0,2 Pi},Assumptions-> (a<-1)]