Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15374 > unrolled thread
| Started by | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| First post | 2013-09-05 12:12 +0000 |
| Last post | 2013-09-08 06:50 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Problem with change of variables in an integral Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-09-05 12:12 +0000
Re: Problem with change of variables in an integral Youngjoo Chung <ychung12@gmail.com> - 2013-09-08 06:50 +0000
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Date | 2013-09-05 12:12 +0000 |
| Subject | Re: Problem with change of variables in an integral |
| Message-ID | <l09sej$jbp$1@smc.vnet.net> |
Hello,
Although I know how to make a change of variables in an integral I can only do
it manually by applying a substitution rule to the integrand and the
differential e.g
{f[z],\[DifferentialD]z}//. {z-> r E^(I
\[Phi]),\[DifferentialD]z->E^(I \[Phi]) \[DifferentialD]r,\[Phi] -> (2\[Pi]/3}
But it cannot applied this substitution rule directly to the integral, e.g.
Integrate[f[z],{z,0,\[Infinity]}] //. {z-> r E^(I
\[Phi]),\[DifferentialD]z->E^(I \[Phi]) \[DifferentialD]r,\[Phi] -> (2\[Pi]/3}
Comparing with the correct result, the exponential factor E^((2 I \[Pi])/3) =
(-1)^(2/3) is missing in the evaluation of the integral. The correct appearance
of the
integral is : Integrate[1/(1+r^3) E^((2 I \[Pi])/3),{r,0,\[Infinity]}]
How can I force Mathematica (V8) to perform the correct transformation of
variables as regards to the integral (and not to its separate parts of it as
{f[z],\[DifferentialD]z} ?
Any suggestions are appreciated.
Robert Kragler
Hello, Robert,
Try this:
Clear[f, \[Phi]];
Map[ReplaceAll[#, {z -> r*Exp[I \[Phi]] , \[Phi] -> 2 \[Pi]/3}] &,
Integrate[f[z], {z, 0, \[Infinity]}]]
to map the replacements directly onto the structures below the Integrate operator. The result is below:
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(\[Infinity]\)]\(f[
\*SuperscriptBox[\(E\), \(I\ \[Phi]\)]\ r] \[DifferentialD]\((
\*SuperscriptBox[\(E\), \(I\ \[Phi]\)]\ r)\)\)\)
If it is used, for example, with the function f[z_]:=1/(1+z^3), as you tried:
Clear[f, \[Phi]];
f[z_] := 1/(1 + z^3);
Map[ReplaceAll[#, {z -> r*Exp[I \[Phi]] , \[Phi] -> 2 \[Pi]/3}] &,
Integrate[f[z], {z, 0, \[Infinity]}]]
it gives
(2 \[Pi])/(3 Sqrt[3])
When I do the same "by hand":
\[Phi] = 2 \[Pi]/3;
Integrate[Exp[I \[Phi]]/(
1 + (Exp[I \[Phi]]*r)^3), {r, 0, \[Infinity]}]
I get this:
(2 (-1)^(2/3) \[Pi])/(3 Sqrt[3])
which in my opinion is almost the same, though not entirely. I do not see, where from the difference comes.
Surprisingly strange result has been delivered, when I used Esc+e+e+Esc instead of Exp to check of how the "hand-made" transformation would work:
\[Phi] = 2 \[Pi]/3;
Integrate[E^(i \[Phi])/(1 + (E^(i \[Phi]) r)^3), {r, 0, \[Infinity]}]
The answer was:
ConditionalExpression[(2 E^((2 i \[Pi])/3) \[Pi])/(
3 Sqrt[3] (E^(2 i \[Pi]))^(1/3)),
Im[E^(-2 i \[Pi])] != 0 || Re[E^(-2 i \[Pi])] >= 0]
which I do not understand. I do it on PC, Win XP, Mathematica 9.0.1.0. I would be v=
ery interested in comments of the Community on this matter.
Best, Alexei
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu
[toc] | [next] | [standalone]
| From | Youngjoo Chung <ychung12@gmail.com> |
|---|---|
| Date | 2013-09-08 06:50 +0000 |
| Message-ID | <l0h6np$7he$1@smc.vnet.net> |
| In reply to | #15374 |
Dear Alexei,
Integrate[...] in Map[...] will be evaluated first before Map can apply ReplaceAll[...], so nothing is done by Map.
There is a typo in
Integrate[E^(i \[Phi])/(1 + (E^(i \[Phi]) r)^3), {r, 0, \[Infinity]}]
i needs to be changed to I. Then it will produce the same result.
Transforming integrals by change of variables is not straightforward in Mathematica, especially if the integral can be evaluated in closed form. One method involves wrapping the integral with Hold or HoldForm so that evaluation is not done. In addition, simple replacement of the integration variables will not work and the integrand must be divided by the Jacobian corresponding to the variable transformation.
Another method is to write a customized code based on the box language of Mathematica to interpret the 2-D form of integrals, which does not evaluate the integrals but does so only when asked. This is what is done in the SymbolicComputing package (http://symbcomp.gist.ac.kr, WTC 2011). The commands are:
<<SymbolicComputing`
SCTransInt[\[Integral]f[z] \[DifferentialD]z,
TransVar -> {z, r, z == r E^(I \[Phi])},
ReplVar -> {r, 0, \[Infinity]}] /. \[Phi] -> 2 \[Pi]/3
It is to be noted that once the package is loaded, integrals, products and sums in 2-D form are not evaluated. Evaluation can be done using the functions SCEvalInt, SCEvalProd, and SCEvalSum, respectively. Kernel functions Integrate, Product, and Sum are the same and can be used for immediate evaluation.
Sincerely,
Youngjoo Chung
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web