# How to get an integer from a complex expression? This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi, (22/3*sqrt(2)*sqrt(3) + 485/27)^(1/3) + 1/9/(22/3*sqrt(2)*sqrt(3) + 485/27)^(1/3) + 20/3 equals 10. But how can I get 10 as an integer, as the complex expression has more complex solutions?

edit retag close merge delete

1

Can you explain what you mean by "get 10 as an integer"? you can use n() to get 10.

I still don't get it. What do you mean by 10 as an integer. ((22/3*sqrt(2)*sqrt(3) + 485/27)^(1/3) + 1/9/(22/3*sqrt(2)*sqrt(3) + 485/27)^(1/3) + 20/3).n() = 10.00. What do you want to use the answer for?

Thanks for your reply. The complex expression is the solution found by solve, and from theory I know the answer must be an integer. I can use *.n() but that is a real/complex number coincidently equal to 10. What I'm looking for is a solution which is really an integer e.g. is_integer should be True.

Sort by » oldest newest most voted This post is a wiki. Anyone with karma >750 is welcome to improve it.

You can get 10 by .rhs() (it stands for "right hand side"):

((22/3*sqrt(2)*sqrt(3) + 485/27)^(1/3) + 1/9/(22/3*sqrt(2)*sqrt(3) + 485/27)^(1/3) + 20/3 == 10).rhs()

more