Can I define an equation (for example, x+1 == y^2 + 2), and tell Mathematica to square both sides?
If not, what is an equivalent way to achieve this?
|
Can I define an equation (for example, If not, what is an equivalent way to achieve this? |
||||
|
Do you mean this?
Or
, according to Vitaliy Kaurov's advice.
|
|||||||
|
|
As this has been answered, already, here is my solution using Distribute:
|
|||||
|
|
When you have an equation:
What Mathematica actually "sees" is this:
In order to square both sides, you somehow have to "reach into" the This can be done with pattern matching, using
You'll notice that this matches expression pattern Another way to do this would be, as @Jens' link points out, using We use this to our advantage with the pure function which squares both sides of the expression.
|
|||
|
|
=to a==as the latter represents equality while the former is used to set a variable. – rcollyer Nov 28 '12 at 5:15