2
$\begingroup$

I'm working on a short script that I can repeatedly use to solve parametric surface integrals. There is a post on this elsewhere on MSE, but it is a complicated doublecontourintegral function. It is impossible to parse for a newcomer like me, and it seems possible to create something more simple.

Here's an example problem:

Find the surface integral of $(x + y + s)dS$, where S is the parallelogram with parametric equations $x = u + v$; $y = u - v$; $z = 1 + 2u + v$; and $0 \leq u \leq 2$, $0 \leq v \leq 1$.

So I wanted to write a script that I can just type in the non-parametrized equation, i.e., $(x + y + s)$ in this example. Then I'd enter in the parameters for x, y, and z (given in this problem).

Next, I'd take the partial derivatives with respect to u an v of the parametrized equation.

Next, I'd cross product those two partial derivatives and find its magnitude, using Norm.

Next, I'd re-parametrize $(x + y + s)$.

Finally, I'd integrate the re-paremetrized surface, multiplied by the magnitude of the partials, over the region, given in this problem as $0 \leq u \leq 2$, $0 \leq v \leq 1$.

I am new to Mathematica, and I started this sequence with the following code, but it doesn't seem to work. I'd welcome any help.

Clear[x, y, u, v]
x[u_, v_] := u + v;
y[u_, v_ ] := u - v;
z[u_, v_] := 1 + 2 u + v;
R[u_, v_] := {x[u_, v_], y[u_, v_], z[u_, v_]}

UPDATE: This code works well on problems I've tried. But I'm having trouble with another problem. The book answer is 1/(10sqrt(2)). I'm attaching as a picture its worked example. But both of your methods give 1/5sqrt(2). Did I miss something? Is the book in error? Here's the code I used, and the book's answer.

x[u_, v_] := u Cos[v];
y[u_, v_] := u Sin[v];
z[u_, v_] := u;
r[u_, v_] := {x[u, v], y[u, v], z[u, v]};
reg = ParametricRegion[r[u, v], {{u, 0, 1}, {v, 0, Pi/2}}];
Integrate[x y z, {x, y, z} \[Element] reg]

And here's is the book answer, which is Problem 6:

enter image description here

$\endgroup$
2
  • $\begingroup$ 1/(5 Sqrt[2]) == Sqrt[2]/10 $\endgroup$ – cvgmt Dec 28 '20 at 4:37
  • $\begingroup$ Of course it is. Drrr. Apologies. $\endgroup$ – JDVC Dec 28 '20 at 4:39
2
$\begingroup$
x[u_, v_] := u + v;
y[u_, v_] := u - v;
z[u_, v_] := 1 + 2 u + v;
r[u_, v_] := {x[u, v], y[u, v], z[u, v]};
Integrate[(x[u, v] + y[u, v] + z[u, v]) Norm@
   Cross[D[r[u, v], u], D[r[u, v], v]], {u, 0, 2}, {v, 0, 1}]

11 Sqrt[14]

Or

x[u_, v_] := u + v;
y[u_, v_] := u - v;
z[u_, v_] := 1 + 2 u + v;
r[u_, v_] := {x[u, v], y[u, v], z[u, v]};
 reg =ParametricRegion[r[u, v], {{u, 0, 2}, {v, 0, 1}}];
Integrate[x + y + z, {x, y, z} ∈ reg]

11 Sqrt[14]

$\endgroup$
9
  • $\begingroup$ Thanks so much for the code. It is very helpful. See my update above, if you can, and perhaps you can clarify? $\endgroup$ – JDVC Dec 28 '20 at 4:21
  • $\begingroup$ And this code doesn't seem (?) to work if the parameters are trig functions. I get strange message when I use trig functions in the parameters. Is that right? $\endgroup$ – JDVC Dec 28 '20 at 4:34
  • $\begingroup$ @BRC You can use Clear["`*"]; to clear the variable before the new evaluation. $\endgroup$ – cvgmt Dec 28 '20 at 4:39
  • $\begingroup$ I tried that, alas. If you make the integrand something with just one variable, would that make the code unworkable? For example, in a similar problem to "Update' above, I changed the integrand to just "y" and it gave me gobbledygook: \!(*UnderscriptBox[([Integral]), ({x, y, z} [Element] ParametricRegion[{{Cos[v]\ u, u\ Sin[v], v}, 0 [LessEqual] u [LessEqual] 1 && 0 [LessEqual] v [LessEqual] *FractionBox[([Pi]), (2)]}, {u, v}])])y $\endgroup$ – JDVC Dec 28 '20 at 4:51
  • $\begingroup$ Perhaps if I just have a single (or even two )variable in the integrand (all of the other problems had x, y, and z), I need some kind of placeholder for the missing variable? $\endgroup$ – JDVC Dec 28 '20 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.