# Finding the roots of a vector function: Sin[x + y], Cos[x - y], x^2 + y^2 - z

{Sin[x+y],Cos[x-y],x^2+y^2-z}


I've tried to use the FindRoot function, which gives me an answer. However, it also says "Failed to converge to the requested accuracy or precision within 100 iterations".

g1 = FindRoot[{Sin[x + y], Cos[x - y], x^2 + y^2 - z}, {x, 0, 2 Pi}, {y, 0, 2 Pi}, {z, 0, 2 Pi}]


I also tried:

NSolve[{Sin[x + y], Cos[x - y], x^2 + y^2 - z}]


but that said "inverse functions are being used by NSolve, so some solutions may not be found; use Reduce for complete solution information. When I use Reduce, I get the following as my answer "Reduce[{Sin[x + y], Cos[x - y], x^2 + y^2 -z}]".

I also tried to plot the three functions, to look to see where the graphs intersect, and then I would determine the roots by choosing an estimated value. However, I can't figure out the code for graphing all three of them because the last one has a third variable.

• As I understand, you want to find where all 3 functions are zeros? – m0nhawk Apr 2 at 2:21
• Yes exactly, where they would all intersect. – Claire Apr 2 at 2:22
• You need to make it an equation in order to be able to solve/reduce: Reduce[{Sin[x + y], Cos[x - y], x^2 + y^2 - z} == 0, {x, y, z}] – bill s Apr 2 at 2:22
• @bills you can post this as an answer. – m0nhawk Apr 2 at 2:25

One problem is that Solve and Reduce and similar functions require complete equations. Hence:

Reduce[{Sin[x + y], Cos[x - y], x^2 + y^2 - z} == 0, {x, y, z}]


gives a nice set of answers.

Restricting all variables, you get a few single points

Solve[{0 < z < 2 Pi, 0 < x < 2 Pi, 0 < y < 2 Pi, Sin[x + y] == 0,
Cos[x - y] == 0, x^2 + y^2 - z == 0}, {x, y, z}, Reals
]

(*   {{x -> \[Pi]/4, y -> (3 \[Pi])/4, z -> (5 \[Pi]^2)/8},
{x -> (3 \[Pi])/4, y -> \[Pi]/4, z -> (5 \[Pi]^2)/8}}   *)

ContourPlot3D[
Evaluate@Thread[{Sin[x + y], Cos[x - y], x^2 + y^2 - z} == 0],
{x, 0,2 Pi}, {y, 0, 2 Pi}, {z, 0, 2 Pi},
ContourStyle -> {Red, Green, Blue}]