I'd like to solve the following expression:
for the following equation:
How? Is there a function for that. This was just an example.
Thanks!!
As pointed out in the comments, you can't solve an expression. But I'm guessing that what you meant to ask was how you can find the value of an expression (a+b
) subject to a constraining equation (a^3 + 3 a^2 b + 3 a b^2 + b^3 == c
). In general, that's not possible - that is, for an arbitrary expression subject to an arbitrary constraint, there's no guarantee that the expression will have the same value at all the points satisfied by the constraint.
What you can do sometimes is this: introduce a new variable to represent the value of your expression, solve the resulting equation for one of the original variables (perhaps manually), then substitute it into the condition. For example, in this case:
x
represent the value of a + b
a + b == x
for either a
or b
, giving a = x - b
or b = x - a
Substitute either of these into the condition,
a^3 + 3 a^2 b + 3 a b^2 + b^3 == c /. a -> x-b // FullSimplify
If your expression (a + b
) has a value that is constant over the solution set of the condition, and if Mathematica is able to simplify it, then you'll get a result that is independent of any of the variables in the expression (a
and b
). In this example you get the result c == x^3
, so that is the case.