I'm trying to make to make a script to help me with my maths
example equation: y=(4*(x*2)^(2x+4))+4*x^2
For this to work, I just need it to understand that only (x*2)
needs to be put to the power of (2x+4)
, and then to sub that back into the original equation, which of course you can just eval()
an answer.
I want to calculate the values of y, when I know an x value. This WOULD be relatively easy if it weren't for powers. I just can't get my head round how to do them.
I know you can use pow()
, but I'm trying to make a script to work with any equation. So it sort of needs to understand the syntax.
Any suggestions how to go about this?