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.Sun, 03 Sep 2017 10:59:01 +0200Get the nth term of an equation.rhs() sumhttps://ask.sagemath.org/question/38720/get-the-nth-term-of-an-equationrhs-sum/ Hi
equ0 = term_0 == term_1 + term_2 + term_3
I want to extract term_1 + term_2 to work with.
I have been looking for a long time without success,
I read the whole page:
[link text](http://doc.sagemath.org/html/en/reference/calculus/sage/symbolic/expression.html)
example:
$
{\left| p\left(\rho_{\epsilon} e^{\left(i \, \theta_{\epsilon}\right)} + w\right) \right|}^{2} =
\rho_{0} \rho_{\epsilon}^{m} \rho_{m} e^{\left(i \, m \theta_{\epsilon} - i \, \theta_{0} + i \, \theta_{m}\right)} +
\rho_{0} \rho_{\epsilon}^{m} \rho_{m} e^{\left(-i \, m \theta_{\epsilon} + i \, \theta_{0} - i \, \theta_{m}\right)} + \rho_{\epsilon}^{2 \, m} \rho_{m}^{2} + \rho_{0}^{2}
$ortolljSun, 03 Sep 2017 10:59:01 +0200https://ask.sagemath.org/question/38720/Filtering an expression: keeping only term with even powerhttps://ask.sagemath.org/question/9456/filtering-an-expression-keeping-only-term-with-even-power/In the expression
$$
x^2 y^2+x y^2+x^3y + 5 x^4 y^4
$$
I would like to keep only the term where the variables have even power
$$
x^2y^2+5 x^4 y^4
$$
Is there a way to do it?
I look into this [post](http://ask.sagemath.org/question/1747/extract-terms-from-a-sum?answer=2598#2598).
But once I get the operands, I don't see how to analyze the variable exponent.Nicolas Essis-BretonMon, 22 Oct 2012 19:26:25 +0200https://ask.sagemath.org/question/9456/Extract terms from a sumhttps://ask.sagemath.org/question/9295/extract-terms-from-a-sum/Is there some way to programmatically extract the first, second, third, and so on terms from a sum of symbolic terms (or equivalently, turn such a sum into the list of its summands)? For example, after
sage: A,B,C = var('A'), var('B'), var('C')
sage: F = A*B+C; F
A*B + C
Is there some method you can call on F to extract A*B (or C)? This would be useful especially for displaying sage in LaTeX via sageTeX when a formula that is the sum of 4 terms (say) runs over the margin and has to be split up somehow. I would also be interested in a workaround in sageTeX that would allow you to flexibly insert a linebreak in a formula under the circumstances that the formula generated by Sage got too long for a line.
heatkernelWed, 05 Sep 2012 00:05:14 +0200https://ask.sagemath.org/question/9295/