[Mathematica] Symbolic integrals simplification

  • Mathematica
  • Thread starter guerom00
  • Start date
  • #1
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:
 

Answers and Replies

  • #2
phyzguy
Science Advisor
4,602
1,557
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
93
0
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
alphysicist
Homework Helper
2,238
1
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 :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
93
0
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:
  • #6
alphysicist
Homework Helper
2,238
1
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:

Related Threads on [Mathematica] Symbolic integrals simplification

Replies
1
Views
2K
Replies
1
Views
1K
Replies
9
Views
4K
Replies
6
Views
3K
Replies
5
Views
4K
Replies
0
Views
2K
Replies
3
Views
4K
Replies
2
Views
3K
Replies
3
Views
3K
  • Last Post
Replies
6
Views
841
Top