Ask Your Question
0

How to simplify expression after diff so that the denominator remains unchanged relative to the initial expression. [closed]

asked 2023-10-22 20:48:05 +0100

y023rus gravatar image

Dear experts, I have next initial expression: $$y=\dfrac{2x-3}{5-2x}$$ and I need find y'. In this case I use rule $$\left( \dfrac{u}{v} \right)' = \dfrac{u'v-uv'}{v^2} $$ and expect to obtain next result after simplification: $$y' = \dfrac{4}{(5-2x)^2}$$ But after diff((2x-3)/(5-2x),x) and simplification with factor() I get. $$y' = \dfrac{4}{(2x-5)^2}$$ How I can get $$(5-2x)^2$$ in denominator of derivative?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by y023rus
close date 2023-10-24 20:21:12.590365

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-10-23 20:45:49 +0100

Max Alekseyev gravatar image

You can use .denominator() to extract the denominator:

diff((2*x-3)/(5-2*x),x).factor().denominator()

or

diff((2*x-3)/(5-2*x),x).denominator().factor()
edit flag offensive delete link more

Comments

your code gives $(2x - 5)^2$ not $(5-2x)^2$ as I need

y023rus gravatar imagey023rus ( 2023-10-24 14:16:02 +0100 )edit

Mathematically speaking, it's the same expression. It's just a matter of how Sage orders terms in the representation. There is not much you can do about that, see https://ask.sagemath.org/question/73507/ for details and further references.

Max Alekseyev gravatar imageMax Alekseyev ( 2023-10-24 17:57:39 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2023-10-22 20:48:05 +0100

Seen: 133 times

Last updated: Oct 23 '23