MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Change integral variables

On Apr 27, 7:02 pm, Budaoy <yaomengli... at> wrote:
> In Mathematica, how can I change integral variables? For example in
> integration:
> Integrate[Sin[Sqrt[x]], x] if I want to use t^2=x to instead x in the
> integral, how can I achieve this?
> PS: Does Mathematica have a inertial form of some symbolic command,
> for instance, the above integration, if I only want an integration
> form but not an answer, what can I do?
> Thanks.


The following is a rough implementation of an integration by
substitution routine....

In[87]:= IntegrateBySubstitution[integrand_, var_, sub_Equal] :=
Catch[Module[{u, substitution, du, res, x},
   u = First[sub];
   substitution = Last[sub];
   du = D[substitution, var];
   res = Simplify[(integrand /. substitution :> u)/du];

   (* derivative cancels *)
   If[FreeQ[res, var],
    	Throw[{res, u}]

   (* use inverse function to remove var from res *)
   x = First@Flatten@Solve[sub, var];
   res = PowerExpand@Simplify[res /. x];
   {res, u}

Here is the integral you requested:

In[88]:= IntegrateBySubstitution[Sin[Sqrt[x]], x, u == Sqrt[x]]

Out[88]= {2 u Sin[u], u}

And a couple of other examples ;-)

In[89]:= IntegrateBySubstitution[(2 x)/(1 + x^2), x, u == 1 + x^2]

Out[89]= {1/u, u}

In[90]:= IntegrateBySubstitution[(2 x)/(1 + x^2), x, u == x^2]

Out[90]= {1/(1 + u), u}

In[91]:= IntegrateBySubstitution[Sqrt[1 - x + Sqrt[x]], x,
 u == Sqrt[x]]

Out[91]= {2 u Sqrt[1 + u - u^2], u}

In[92]:= IntegrateBySubstitution[Sqrt[1 + Tan[x]], x, u == Tan[x]]

During evaluation of In[92]:= Solve::ifun: Inverse functions are \
being used by Solve, so some solutions may not be found; use Reduce \
for complete solution information. >>

Out[92]= {Sqrt[1 + u]/(1 + u^2), u}



  • Prev by Date: Does Mathematica really need more printed, introductory documentation?
  • Next by Date: Question about OneIdentity
  • Previous by thread: Re: Change integral variables
  • Next by thread: Re: Change integral variables