Ask Your Question

Assume a function is real-valued

asked 2022-02-27 20:45:00 +0200

ripple_carry gravatar image

In the following expression:


u = function('u')(z)
v = function('v')(z)

f = u + i * v

# conjugate(diff(u(z), z)) - I*conjugate(diff(v(z), z))

I would like Sage to make the simplification conjugate(diff(u(z), z)) = diff(u(z), z) because $u, v$ are intended to be real-valued. But my first attempt:

assume(u, 'real')

didn't work:

TypeError: self (=u(z)) must be a relational expression

What is the right way to write this assumption?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-02-28 17:22:39 +0200

dsejas gravatar image

Hello, @ripple_carry! The easiest way I know of achieving that effect is to explicitly declare the imaginary part of the function to be zero. Just use the imag_part_func argument for function as follows:


u = function('u',imag_part_func=0)(z)
v = function('v',imag_part_func=0)(z)

f = u + i * v


This outputs

diff(u(z), z) - I*diff(v(z), z)

Hope this helps!

edit flag offensive delete link more

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


Asked: 2022-02-27 20:45:00 +0200

Seen: 415 times

Last updated: Feb 28 '22