First time here? Check out the FAQ!

Ask Your Question
0

assume and simplify

asked 12 years ago

anonymous user

Anonymous

Hello,

assume(u,'complex') ; assume(v,'complex'); assume(u==conjugate(v)) ; 
u-conjugate(v)

returns

u-conjugate(v)

whereas I was expecting

0

What should I do if I want to simplify some computation involving complex numbers along with their conjugates?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 12 years ago

calc314 gravatar image

I think the problem is that you are using assume in some steps when you just need assignment. The code below produces a result of 0.

var('v')
assume(v,'complex')
u=conjugate(v)
u-conjugate(v)
Preview: (hide)
link

Comments

But in some case we can't replace an assumption with an assignment. For exemple if we know that x²=y³, but both x and y are unknown, one would expect x**2-y**3 to return 0 I guess sage doesn't perform this kind of things?

tim gravatar imagetim ( 12 years ago )

Yeah, I don't think that this kind of "assumption" is doable in Maxima (which does our assumptions under the hood). But @achrzesz has the usual way to handle this kind of thing, via substitution and/or pattern matching, which hopefully is what you are looking for.

kcrisman gravatar imagekcrisman ( 12 years ago )
0

answered 12 years ago

achrzesz gravatar image

updated 12 years ago

sage: var('x y');
sage: (x^2-y^3).subs_expr(x^2==y^3)    
0    
sage: (x-conjugate(y)).subs_expr(x==conjugate(y))    
0   
sage: maxima('x^2-y^3,x^2=y^3')              
0
sage: maxima('x-conjugate(y),x=conjugate(y)')     
0
#replace x^2 by y^3 in x^4-y^6
sage: maxima('ratsubst(y^3,x^2,x^4-y^6)')
0
#simplify according to the rules
sage: maxima('scsimp(x^4-y^6,x^2=y^3)')
0
Preview: (hide)
link

Comments

This doesn't perform any nontrivial simplification, for example x^4-y^6 doesn't return 0. But still my question was answered. Thanks everyone.

tim gravatar imagetim ( 12 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 2,114 times

Last updated: Aug 28 '12