ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 24 Feb 2018 09:38:08 +0100Integrate after Pullbackhttps://ask.sagemath.org/question/41246/integrate-after-pullback/ How to integrate a differential for obtained by pullback?
Let say I have calculated the pullback of some differential form, the result is (in latex):
$\rho^2\sin(\theta)\,\mathrm{d}\rho\wedge\mathrm{d}\theta\wedge\mathrm{d}\phi$
The triple integral is:
sage: integral(integral(integral(rho^2*sin(theta),rho,0,1),theta,0,pi/7),phi,0,pi/5)
But I want this process to be automatic, i.e. not manually write the integrand in the triple integral by myself. I want to be able to extract the integrand from the pullback and put it in the triple integral. I that possible?
Daniel
Fri, 23 Feb 2018 20:29:37 +0100https://ask.sagemath.org/question/41246/integrate-after-pullback/Answer by eric_g for <p>How to integrate a differential for obtained by pullback?</p>
<p>Let say I have calculated the pullback of some differential form, the result is (in latex):</p>
<pre><code>$\rho^2\sin(\theta)\,\mathrm{d}\rho\wedge\mathrm{d}\theta\wedge\mathrm{d}\phi$
</code></pre>
<p>The triple integral is:</p>
<pre><code>sage: integral(integral(integral(rho^2*sin(theta),rho,0,1),theta,0,pi/7),phi,0,pi/5)
</code></pre>
<p>But I want this process to be automatic, i.e. not manually write the integrand in the triple integral by myself. I want to be able to extract the integrand from the pullback and put it in the triple integral. I that possible?</p>
<p>Daniel</p>
https://ask.sagemath.org/question/41246/integrate-after-pullback/?answer=41248#post-id-41248Suppose your 3-form is `tau`; to extract the integrand, simply use `tau[1,2,3].expr()`, or `tau[frame,1,2,3,chart].expr()` if the vector frame and the chart are not the default ones on the manifold. Note that `expr()` returns a symbolic expression, which can be passed directly to `integrate`. For instance, for the example of [question 41228](https://ask.sagemath.org/question/41228), this would be
sage: tau.display(spherical.frame(), spherical)
tau = rho^2*sin(theta) drho/\dtheta/\dphi
sage: tau[spherical.frame(),1,2,3,spherical].expr()
rho^2*sin(theta)
Fri, 23 Feb 2018 21:53:54 +0100https://ask.sagemath.org/question/41246/integrate-after-pullback/?answer=41248#post-id-41248Comment by danielvolinski for <p>Suppose your 3-form is <code>tau</code>; to extract the integrand, simply use <code>tau[1,2,3].expr()</code>, or <code>tau[frame,1,2,3,chart].expr()</code> if the vector frame and the chart are not the default ones on the manifold. Note that <code>expr()</code> returns a symbolic expression, which can be passed directly to <code>integrate</code>. For instance, for the example of <a href="https://ask.sagemath.org/question/41228">question 41228</a>, this would be</p>
<pre><code>sage: tau.display(spherical.frame(), spherical)
tau = rho^2*sin(theta) drho/\dtheta/\dphi
sage: tau[spherical.frame(),1,2,3,spherical].expr()
rho^2*sin(theta)
</code></pre>
https://ask.sagemath.org/question/41246/integrate-after-pullback/?comment=41249#post-id-41249thanks Eric.Sat, 24 Feb 2018 09:38:08 +0100https://ask.sagemath.org/question/41246/integrate-after-pullback/?comment=41249#post-id-41249