Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004

Calculate the surface integral of the scalar function f=x+y+zf=x+y+z on the triangle with vertices A(3,0,0), B(0,2,0) and C(0,0,1).


We need to calculate SfdS\iint_S \, f \,dS


We found the surface, parameterized it and ran the SOLVER first (below) and then used that information to get the graphs here.

Graph1: I do not know how to graph a surface where the intervals are not numbers, so I worked around this :)

var ('x y z') plane1=implicit_plot3d(x/3+y/2+z==1,(x,0,3),(y,0,2),(z,0,1),color='red', opacity=.7) Dxy=polygon(([0,0,0],[3,0,0],[0,2,0]),color='purple',opacity=.5) tx=text3d("x",(0.5,0,0)) ty=text3d("y",(3,0.5,0)) tline=text3d("y=-2x/3+2",(2,1.5,0), color='green') show(plane1+Dxy+tx+ty+tline, figsize=4)

Graph 2: We graph the parametrization on the x0y plane and then the integrand as a z-value. (I do know how to do dependent cycles so here I could work with the one interval depending on the second.) 

Spar=polygon(([0,0,0],[3,0,0],[0,2,0])) vs=1 vf=sum([sum([arrow3d((c,d,0),(c+0,d+0,0+(7*c/12+7*d/9+7/6)/vs), color=hue((c+8)/8), width=2) for d in [0..-2*c/3+2,step=0.5]]) for c in [0..3,step=0.5]]) show(Spar+vf, aspect_ratio=(1,1,1))

To use the SOLVER, we parameterize the surface with 2 parameters.

Work particular to this problem: 

== The equation of the plane going through the 3 points is: z=1x3y2z=1-\frac{x}{3}-\frac{y}{2}. Remember to parameterize an explicit function z=f(x,y), we set x=u, y=v and z=f(u,v)

How get: We need a function for the triangle. The triangle lies on the plane passing through A, B and C. 

The normal vector to this plane is: ParseError: KaTeX parse error: Unknown column alignment: * at position 83: …{\begin{array}{*̲{20}{c}} {\vec …

Using A and n\vec n, the equation of the plane is x33+y02+(z0)=0\frac{x-3}{3} +\frac{y-0}{2} +(z-0)=0  or x3+y2+z=1{\frac{x}{3}+\frac{y}{2}+z=1}  or explicitly  S:z=1x3y2 \boxed{\color{red}{S:\,z=1-\frac{x}{3}-\frac{y}{2}}}

== So: S=S = {x=uy=vz=1u3v2u [0,3]v[0,3u2+2]\left\{ \begin{array}{l}x = u \\y = v\\z =1-\frac{u}{3}-\frac{v}{2}\end{array} \right.\,\,\,\,\,u \in [0,3 ] \,\,\,\,v \in [0,\frac{-3u}{2}+2]

To get the intervals: We find the vertices of the triangle in the u0v = x0y plane. In this plane z=0. The vertices of the triangle in 3d are (3,0,0), (0,2,0) and (0,0,1). In the u0v plane, we have:  V1(u=3,v=0), V2(u=0,v=2) and V3(u=0,v=0). We draw this region. It is a triangle where u goes from 0 to 3 and v goes from 0 to the line joining V1 and V2. The equation of this line is v=-2u/3+2. 


Hand Solution or just go directly to the SOLVER:

We could calculate using either the explicit formula or the parameterized form. We will use the parameterized form so we need the formula:

Sf(x,y,z)dS=Dxyf(x,y,z(x,y))\iint_S\,{f(x,y,z)}\,dS=\iint_{D_{xy}}\,{f(x,y,z(x,y))} dSu×dSvdudv\left\| {d{{\vec S}_u} \times d{{\vec S}_v}} \right\| \,du\,dv where  dSu=<xu,yu,zu>d{{\vec S}_u}=\,\lt \frac{\partial x}{\partial u},\frac{\partial y}{\partial u},\frac{\partial z}{\partial u }\gt and dSv=<xv,yv,zv>d{{\vec S}_v}=\,\lt \frac{\partial x}{\partial v},\frac{\partial y}{\partial v},\frac{\partial z}{\partial v} \gt

We have 

dSu=<xu,yu,zu>=<1,0,13>d{{\vec S}_u}=\,\lt \frac{\partial x}{\partial u},\frac{\partial y}{\partial u},\frac{\partial z}{\partial u} \gt \,=\, \lt 1,0,\frac{-1}{3} \gt\, and dSv=<xv,yv,zv>=<0,1,12> d{{\vec S}_v}=\,< \frac{\partial{x}}{\partial{v}},\frac{\partial{y}}{\partial{v}},\frac{\partial{z}}{\partial{v}}> \, = \, < 0,1,\frac{-1}{2} >

So ParseError: KaTeX parse error: Unknown column alignment: * at position 61: …{\begin{array}{*̲{20}{c}} {\vec …  and  dSu×dSv=76\left\| {d{{\vec S}_u} \times d{{\vec S}_v}} \right\| =\frac{7}{6}.

f=x+y+z=u+v+1u3v2=2u3+v2+1f=x+y+z=u+v+1-\frac{u}{3}-\frac{v}{2}=\frac{2u}{3}+\frac{v}{2}+1

Finally SfdS=0302u/3+2(2u3+v2+1)76dvdu=76=03(13u2+3)du=766=7\iint_S\, f \,dS=\int_0^3 \int_0^{-2u/3+2}\,(\frac{2u}{3}+\frac{v}{2}+1) \cdot \frac{7}{6} \,dv \, du = \frac{7}{6} = \int_0^3 (\frac{-1}{3}u^2+3) \,du=\frac{7}{6} \cdot 6 = \boxed{7}


SOLVER: Our program follows the hand solution method. Everything in red requires something particular to your problem!

  1. Parameterize S and input as vector function. Requires parametrization - done above.
  2. Input f(x,y,z).
  3. Find the partials of S. 
  4. Find the vector product of the partials. Find the magnitude (intensity) of this vector.
  5. Substitute parameterization in f.
  6. Find the integrand.
  7. Find intervals of integration and integrate. Requires intervals of parametrization - done above.

Step 0: The program declares our variables. We are given variables (x,y,z). We need (u,v) as parameters.

var ('u v'); var('x y z')
(u, v) (x, y, z)

Step 1: We define S\vec S and F\vec F. Changes with problem; you must input your parametrization in Sf and your function in f.

Sf=vector((u,v,1-u/3-v/2)) f=x+y+z

Step 2: The program finds the partial derivatives.

Sprime_u=diff(Sf,u) view(Sprime_u)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(1,\,0,\,-\frac{1}{3}\right)
Sprime_v=diff(Sf,v) view(Sprime_v)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(0,\,1,\,-\frac{1}{2}\right)

Step 3: The program calculates dSu×dSv\left\| {d{{\vec S}_u} \times d{{\vec S}_v}} \right\|

npar=Sprime_u.cross_product(Sprime_v) np=abs(npar) view(np)
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{7}{6}

Step 4: The program defines a standard sage function for "change of variables" for a 2-variable parametrization (surface).

The program changes the variables of ff.

def changevar(h, eqn, newvar1,newvar2): return h.substitute(eqn)
f=changevar(f,x==Sf[0],u,v) f=changevar(f,y==Sf[1],u,v) f=changevar(f,z==Sf[2],u,v) view(f)
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{2}{3} \, u + \frac{1}{2} \, v + 1

Step 5: Then program finds the mixed product and multiplies it by the orientation from step 3.

integrand=np*f view(integrand)
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{7}{9} \, u + \frac{7}{12} \, v + \frac{7}{6}

Step 6: The program computes the integral. Changes with problem - we must put in our intervals of integration.

integrand2=integral(integrand,(v,0,-2*u/3+2)) view(integrand2)
\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{7}{18} \, u^{2} + \frac{7}{2}
result=integral(integrand2,(u,0,3)) view(result)
\newcommand{\Bold}[1]{\mathbf{#1}}7
n(result)
7.00000000000000


So: S(x+y+z)dS=7\iint_S (x+y+z) \,dS = 7 (S is the triangle with vertices A(3,0,0), B(0,2,0) and C(0,0,1).)