First time here? Check out the FAQ!

Ask Your Question
2

Full simplification of power doesn't work

asked 4 years ago

Cyrille gravatar image
     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 ?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 4 years ago

tmonteil gravatar image

When 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
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 786 times

Last updated: May 10 '20