# [Mathematica] Symbolic integrals simplification

• Mathematica
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

## Answers and Replies

Related MATLAB, Maple, Mathematica, LaTeX News on Phys.org
phyzguy
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
Any other idea ?

alphysicist
Homework Helper
Hi guerom00,

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
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?

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 [Broken]

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:
alphysicist
Homework Helper
Really ?! Not for me…

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

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 [Broken]

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: