[Mathematica] Symbolic integrals simplification

  • Context: Mathematica 
  • Thread starter Thread starter guerom00
  • Start date Start date
  • Tags Tags
    Integrals Mathematica
Click For Summary

Discussion Overview

The discussion revolves around the simplification of symbolic integrals in Mathematica, specifically how to factor out constants from integrals when they do not depend on the variable of integration. Participants explore methods to achieve this and share their experiences with different expressions and versions of Mathematica.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks a method to simplify the integral Integrate[a*f[t],{t,0,y}] to a*Integrate[f[t],{t,0,y}] in Mathematica.
  • Another participant suggests using the ReplaceAll function to manually replace the integral expression with the desired form.
  • A participant expresses that the suggested method is impractical due to the complexity of their expression.
  • Further inquiry is made about the nature of the variable a and whether it is defined in a way that affects the simplification.
  • One participant claims that their version of Mathematica successfully factors out a from the integral, while another participant disagrees, indicating a potential difference in software versions or definitions.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the effectiveness of the methods discussed, as some find success in factoring out constants while others do not. The discussion remains unresolved regarding the best approach to simplify the integral in complex cases.

Contextual Notes

Participants mention that the complexity of their expressions and potential differences in Mathematica versions may influence the outcomes of their attempts to simplify integrals.

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

  • · Replies 1 ·
Replies
1
Views
3K
Replies
8
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K