From: Jesse Perla on 30 May 2010 23:45 I have an integral involving constants and an 'unknown' function. I would like to expand it out to solve for the constants and keep the integrals of the unknown function as expected. i.e. Integrate[a + z + s[z], {z, clow, chigh}] I want to get out: (a*chigh + chigh^2/2 - a*clow - clow^2/2) + Integrate[s[z], {z, clow, chigh}] However, FullSimplify, etc. don't seem to do anything with this. Any ideas?
From: Peter Pein on 1 Jun 2010 04:22 Hi Jesse, with Distribute[Integrate[a + z + s[z], {z, clow, chigh}]] you get: chigh^2/2 + a*(chigh - clow) - clow^2/2 + Integrate[s[z], {z, clow, chigh}] Peter Am Mon, 31 May 2010 03:45:33 +0000 (UTC) schrieb Jesse Perla <jesseperla(a)gmail.com>: > I have an integral involving constants and an 'unknown' function. I > would like to expand it out to solve for the constants and keep the > integrals of the unknown function as expected. > i.e. > Integrate[a + z + s[z], {z, clow, chigh}] > > I want to get out: > (a*chigh + chigh^2/2 - a*clow - clow^2/2) + Integrate[s[z], {z, clow, > chigh}] > > However, FullSimplify, etc. don't seem to do anything with this. Any > ideas? >
From: David Park on 1 Jun 2010 04:20 The Presentations package ($50) from my web site has functionality for this. The Student's Integral section allows you to write integrate[...] (small i) instead of Integrate[...] and obtain the integral in a held form. There are then commands to manipulate the integral (operating on the integrand, change of variable, integration by parts, trigonometric substitution, and breaking the integral out) and then evaluate using Integrate, NIntegrate, or a custom integral table. Also, you can pass any assumptions at the time you use Integrate, instead of when the integral is initially written, so it always formats nicely. The following code also uses another Presentations routine, MapLevelParts, that allows you to apply an operation to a subset of level parts in an expression - here the two integrals that can be evaluated without asking Mathematica to evaluate the integral with the undefined function. I copied the output as text, with box structures, so if you copy from the email back into a notebook is should format as a regular expression. Needs["Presentations`Master`"] integrate[a + z + s[z], {z, clow, chigh}] % // BreakoutIntegral % // MapLevelParts[UseIntegrate[], {{1, 2}}] \!\( \*SubsuperscriptBox[\(\[Integral]\), \(clow\), \(chigh\)]\(\((a + z + s[z])\) \[DifferentialD]z\)\) a \!\( \*SubsuperscriptBox[\(\[Integral]\), \(clow\), \(chigh\)]\(1 \[DifferentialD]z\)\)+\!\( \*SubsuperscriptBox[\(\[Integral]\), \(clow\), \(chigh\)]\(z \[DifferentialD]z\)\)+\!\( \*SubsuperscriptBox[\(\[Integral]\), \(clow\), \(chigh\)]\(s[z] \[DifferentialD]z\)\) chigh^2/2+a (chigh-clow)-clow^2/2+\!\( \*SubsuperscriptBox[\(\[Integral]\), \(clow\), \(chigh\)]\(s[z] \[DifferentialD]z\)\) David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: Jesse Perla [mailto:jesseperla(a)gmail.com] I have an integral involving constants and an 'unknown' function. I would like to expand it out to solve for the constants and keep the integrals of the unknown function as expected. i.e. Integrate[a + z + s[z], {z, clow, chigh}] I want to get out: (a*chigh + chigh^2/2 - a*clow - clow^2/2) + Integrate[s[z], {z, clow, chigh}] However, FullSimplify, etc. don't seem to do anything with this. Any ideas?
|
Pages: 1 Prev: Dynamic not displaying the current value Next: Statistics: making random samples |