I am having difficulty with the following question:
Compute the line integral of $$f(x,y)=\frac{xy}{1+x+2y},$$ along the unit quarter-circle in the first quadrant from (1,0) to (0,1).
My problem could either be a mathematic mistake or a Mathematica difficulty, I am not sure which.
I define my function:
f[{x_, y_}] = x y/(1 + x + 2 y)
Then I parametrize the unit quarter circle as follows:
r[t_] = {Cos[t], Sin[t]}
I am going to compute the integral $$\int_0^{\pi/2} f(\vec r(t))\,|\vec r\,'(t)|\,dt,$$ so I perform this next:
integrand = f[r[t]] Sqrt[r'[t].r'[t]] // Simplify
Then I integrate and find a numerical approximation.
Integrate[integrand, {t, 0, \[Pi]/2}]
N[%]
(* 0.168183 *)
Now I do a second parametrization of the unit quarter circle, namely, I let $x=t$, then $y=\sqrt{1-t^2}$, but here I will need to let my $t$-values vary from $t=1$ to $t=0$ in order for the parametrization to move again from the point (1,0) to the point (0,1). So I do this next:
r[t_] = {t, Sqrt[1 - t^2]}
Then I do this:
integrand = f[r[t]] Sqrt[r'[t].r'[t]] // Simplify
Then I integrate from $t=1$ to $t=0$ (and I am expecting the same answer as I got above):
Integrate[integrand, {t, 1, 0}]
% // N
(* -0.168183 *)
I got the negative of the answer above.
So, my question. Am I making some type of mathematical error in my thinking, or is there something strange happening with Mathematica?
Update: MichaelE2 may be right. It may be the $\Delta t$ problem, keeping it positive. In order to have the $t$-values go from $t=0$ to $t=1$, and to have the curve pass from (1,0) to (0,1), I am going to have to choose a different parametrization.
r[t_] = {1 - t, Sqrt[1 - (1 - t)^2]}
Then:
Manipulate[
ParametricPlot[r[t], {t, 0, final}, PlotRange -> 1] /.
Line -> Arrow,
{{final, 0.5}, 0.00001, 1}]
Now we integrate.
integrand = f[r[t]] Sqrt[r'[t].r'[t]] // Simplify;
Integrate[integrand, {t, 0, 1}];
% // N
(* 0.168183 *)
But I am still going to have to take some more time thinking about this.
Integrate[(x y)/(1 + x + 2 y) /. {x -> Cos[\[Theta]], y -> Sin[\[Theta]]}, {\[Theta], 0, \[Pi]/2}]
. $\endgroup$