Ask Your Question
0

incomplete substitution of expression

asked 2015-10-13 07:44:32 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I want to substitute expression of x and y into the equation y^2-x^3+3267*x-45630 which works fine. The tricky part is when i wanted to substitute v^2=p^4-2*p^3+5*p^2+8*p+4 into the equation which would simplify to 0.

p,x,v,y= var('p x v y') 
x=3*((5*p^2+24*p+12*v+24)/p^2) 
y=108*((-p^3+5*p^2+2*p*v+12*p+4*v+8)/p^3) 
eq1=expand(y^2-x^3+3267*x-45630); eq1 
eq=eq1.subs({v^2: p^4-2*p^3+5*p^2+8*p+4});eq

Instead of getting 0 I get this expression here :

46656*v/p^2 - 93312*v/p^3 + 233280*v/p^4 - 46656*v^3/p^6 + 373248*v/p^5 + 186624*v/p^6

I notice that the substitution didn't complete because I still have v^3 which did not simplify using the substitution v^2=p^4-2*p^3+5*p^2+8*p+4. Is there any other correct code I should use instead of subs to make it work?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-10-13 11:50:53 +0100

eric_g gravatar image

If you substitute v instead of v^2 via

sage: eq=eq1.subs({v: sqrt(p^4-2*p^3+5*p^2+8*p+4)})

then you get zero after simplification:

sage: eq.simplify_full()
0
edit flag offensive delete link more

Comments

Thank you @eric_g.. it worked!!

Sha gravatar imageSha ( 2015-10-14 02:33:44 +0100 )edit

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: 2015-10-13 07:44:32 +0100

Seen: 567 times

Last updated: Oct 13 '15