Mathematica [Mathematica] Symbolic integrals simplification

AI Thread Summary
The discussion revolves around simplifying a symbolic integral in Mathematica, specifically the expression Integrate[a*f[t], {t, 0, y}] to a*Integrate[f[t], {t, 0, y}]. One user suggests using the ReplaceAll function to achieve this, but another user finds it impractical due to the complexity of their expression. The conversation highlights a potential version difference in Mathematica, as one user successfully factors out 'a' while the other does not. The complexity of the original application, related to the Magnus expansion of a matrix, is noted but not fully disclosed. The thread concludes with a lack of resolution on the issue, emphasizing the need for further investigation into the problem.
guerom00
Messages
90
Reaction score
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
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.
 
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:
 
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?
 
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:
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:

Similar threads

Back
Top