[Mathematica] Symbolic integrals simplification

In summary, In order to simplify an expression using the ReplaceAll (/.) function, you need to first identify the expression that you want to simplify and then use the ReplaceAll (/.) function to replace all occurrences of the expression with the expression you want.
  • #1
guerom00
93
0
Hello everyone,

I have a symbolic expression like Integrate[a*f[t],{t,0,y}] and I want Mathematica to write it as a*Integrate[f[t],{t,0,y}] i.e. whatever does not depend explicitly on t is a constant which can be factored out of the integral.
How can I do this ?

TIA :smile:
 
Physics news on Phys.org
  • #2
I do this kind of thing by using the ReplaceAll (/.) function to replace one expression by the expression I want. For example:

In[1]:=Stuff = g[Integrate[a f[t], {t, 0, y}]]

In[2]:=Stuff = Stuff /. Integrate[a f[t], {t, 0, y}] -> a Integrate[f[t], {t, 0, y}]

This way everything will get replaced with the expression in the form you want.

Hope this helps.
 
  • #3
Thank you for your answer. Unfortunately, in my case it is just not practical as the expression I want to simplify is just too big :smile:
Any other idea ? :smile:
 
  • #4
Hi guerom00,

guerom00 said:
Hello everyone,

I have a symbolic expression like Integrate[a*f[t],{t,0,y}] and I want Mathematica to write it as a*Integrate[f[t],{t,0,y}] i.e. whatever does not depend explicitly on t is a constant which can be factored out of the integral.
How can I do this ?

TIA :smile:

Can you give more information about your problem and what is represented by a in your complex expression? I mean, if I just type in the above expression from your post, it does factor the a out of the integral. Or if I define a to be some simple function of t, it does factor out constants. Can you give a simple example to show what's happening for you?
 
  • #5
alphysicist said:
I mean, if I just type in the above expression from your post, it does factor the a out of the integral.

Really ?! Not for me…

[PLAIN]http://img413.imageshack.us/img413/993/picture2op.jpg

My real application is too complicated to be posted on the forum. That's symbolic expression for Magnus expansion of some matrix…
 
Last edited by a moderator:
  • #6
guerom00 said:
Really ?! Not for me…

[PLAIN]http://img413.imageshack.us/img413/993/picture2op.jpg

My real application is too complicated to be posted on the forum. That's symbolic expression for Magnus expansion of some matrix…

Here's what it gives for me:

[PLAIN]http://img10.imageshack.us/img10/9724/mathtt.png

so I guess it must just be a difference in versions (unless somehow your a was defined from somewhere else). Sorry I can't help; hopefully someone else can reproduce the behavior.
 
Last edited by a moderator:

Related to [Mathematica] Symbolic integrals simplification

1. How do I simplify a symbolic integral in Mathematica?

To simplify a symbolic integral in Mathematica, you can use the function FullSimplify. This will attempt to simplify the expression using various algebraic and trigonometric identities, as well as other mathematical rules. You can also use the function Simplify which is a faster but less thorough version of FullSimplify.

2. Can Mathematica handle complicated integrals?

Yes, Mathematica is capable of handling complicated integrals. It has a powerful built-in algorithm for solving integrals symbolically, as well as a large library of mathematical identities and techniques. However, there may be cases where the integral is too complex for Mathematica to solve and it will return the integral in its original form.

3. How do I specify the limits of integration in a symbolic integral?

To specify the limits of integration in a symbolic integral, you can use the syntax Integrate[expression, {variable, lower_limit, upper_limit}]. For example, to integrate x^2 from 0 to 1, you would use Integrate[x^2, {x, 0, 1}]. If you do not specify the limits, Mathematica will return the indefinite integral.

4. Can I simplify integrals with multiple variables in Mathematica?

Yes, Mathematica can simplify integrals with multiple variables. You can specify the variables in the same way as with single variable integrals, using the syntax Integrate[expression, {variable1, lower_limit1, upper_limit1}, {variable2, lower_limit2, upper_limit2}, ...]. Mathematica will attempt to simplify the integral with respect to all of the specified variables.

5. Are there any shortcuts for simplifying integrals in Mathematica?

Yes, there are several shortcuts for simplifying integrals in Mathematica. For example, you can use the function Factor to factor out common terms from the integrand, or the function Expand to expand the integrand using the distributive property. You can also use the keyboard shortcut Ctrl + Shift + E to automatically evaluate the integral and simplify it as much as possible.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
373
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
888
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
Back
Top