Solve is an amazing tool, but sometimes it doesn't work in the way I expect it to. The particular instance that is confusing me right now is this:
Solve[a==b&&c==d,a]
I expect it to tell me that a->b, but instead it gives no solutions. I am using version 9, if this makes a difference.
To be clear, my question is not how do I fix this example (e.g. "Ian, just do Solve[a==b&&c==d,{a,c}]"), but rather, why does it think there are no solutions. Bonus if you can provide a tool that does think a->b is a solution.
Update:
Thanks to @MichaelE2 in the comments for the illustrative example -- it made obvious what was not obvious to me before; Solve performs a task which is only an approximation to the everyday meaning of the word "solve". When I think of the expression Solve[expr,vars], what I want it to do is treat every symbol not in the list vars as "known" and solve for the "unknown" symbols in vars. What it actually does is try to find a set of replacements for the symbols in vars such that expr/.soln is True.
This slight difference in meaning is usually not an issue, but for examples like the one above, and also ones like
Solve[{a==b,b==c},c]
these two meanings give very different, but respectively correct, answers.
I guess the updated question is just the bonus: is there a function which does a better job of approximating the "usual" definition of solve.
Solve. TrySolve[a==b&&c==d,{a, c}]– Jason B. Nov 06 '13 at 19:45Solve[a == b || c == d, a], and note thatc == ddoes not evaluate toTrue, unlesscanddhave values. – Michael E2 Nov 06 '13 at 19:46Solvebetter than the documentations "Solve[expr,vars]attempts to solve the systemexprof equations or inequalities for the variablesvars." would be "Solve[expr,vars]attempts to find replacement rules for the symbol(s in)varswhich cause the statementexprto beTrue`". – Ian Hincks Nov 06 '13 at 20:10Solveprovides generic solutions, to get the full solution set you should add this optionMaxExtraConditions -> Allor sometimes you'd better useReduce. See What is the difference between Reduce and Solve?. – Artes Nov 06 '13 at 22:19