# x/.NSolve[f==g,x] does not work when f or g is the output of NDSolve!

I have been trying to put Points at the intersection of two curves, one of which is the ouput of a differential equation solved with NDSolve. The output being an Interpolation, NSolve cannot find the intersection coordinates.

-
NSolve[] wouldn't be up to the task here, as it's mostly intended for algebraic equations. Why not mention the particular "curves" whose intersections you seek? Maybe the differential equation too, while you're at it... –  Guess who it is. Nov 3 '12 at 16:46
The docs do mention that "NSolve deals primarily with linear and polynomial equations." Maybe you should try with FindRoot, but that locates one root at a time as it's a fully numerical function. –  acl Nov 3 '12 at 16:49
Bonjour & bienvenue sur Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2)Read the FAQs! 3) When you see good Q&A, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign –  chris Nov 4 '12 at 10:23

I would use FindRoot in this case. For example:

solution1=NDSolve[{y'[x]==2y[x],y[0]==1},y[x],{x,-1,1}][[1,1,2]];
solution2=NDSolve[{y'[x]==-3y[x],y[0]==3},y[x],{x,-1,1}][[1,1,2]];
Plot[{solution1,solution2,solution1-solution2},{x,-1,1}]
FindRoot[solution1-solution2,{x,0}]


With the results:

-
I could not get FindRoot to work when one functionF"f" is the result of NDSolve and the other function "g"is –  Jean-Pierre Raynauld Nov 3 '12 at 21:18
I could not get FindRoot to work when "f" is the output of NDSolve and "g" is a simple function like y=2x! –  Jean-Pierre Raynauld Nov 3 '12 at 21:20
@Jean, as you've been told previously, edit your question to include the Mathematica code you already have, including the NDSolve[]` bits. –  Guess who it is. Nov 3 '12 at 23:54