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, 10 May 2020 04:18:16 +0200Full simplification of power doesn't workhttps://ask.sagemath.org/question/51359/full-simplification-of-power-doesnt-work/ x, a =SR.var('x a')
Uf1= x^a
ar1_x=diff(Uf1, x).full_simplify()
ar1_xx=diff(Uf1, x,2)
raar1 = -diff(Uf1, x,2)/diff(Uf1, x).full_simplify()
show(LatexExpr("U^{'}(x) ="+latex(ar1_x)))
show(LatexExpr("U^{''}(x) ="+latex(ar1_xx)))
show(LatexExpr("R_a(x) ="+latex(raar1)))
Why raar1 is not fully simplified ?Sun, 10 May 2020 00:22:33 +0200https://ask.sagemath.org/question/51359/full-simplification-of-power-doesnt-work/Answer by tmonteil for <pre><code> x, a =SR.var('x a')
Uf1= x^a
ar1_x=diff(Uf1, x).full_simplify()
ar1_xx=diff(Uf1, x,2)
raar1 = -diff(Uf1, x,2)/diff(Uf1, x).full_simplify()
show(LatexExpr("U^{'}(x) ="+latex(ar1_x)))
show(LatexExpr("U^{''}(x) ="+latex(ar1_xx)))
show(LatexExpr("R_a(x) ="+latex(raar1)))
</code></pre>
<p>Why raar1 is not fully simplified ?</p>
https://ask.sagemath.org/question/51359/full-simplification-of-power-doesnt-work/?answer=51360#post-id-51360When you write:
raar1 = -diff(Uf1, x,2)/diff(Uf1, x).full_simplify()
what is fully simplified is `diff(Uf1, x)`, not `diff(Uf1, x,2)/diff(Uf1, x)`
If you want the `full_simplify` method to be applied to the whole `diff(Uf1, x,2)/diff(Uf1, x)`, you have to add parentheses :
sage: raar1 = -(diff(Uf1, x,2)/diff(Uf1, x)).full_simplify()
sage: raar1
-(a - 1)/x
Sun, 10 May 2020 04:18:16 +0200https://ask.sagemath.org/question/51359/full-simplification-of-power-doesnt-work/?answer=51360#post-id-51360