Plot[{Tan[x], x Sin[x]}, {x, -8, 8}, MeshFunctions -> {Tan[#] - # 
Sin[#] &}, Mesh -> {{0.0}}, MeshStyle -> Directive[Red, 

Just as the picture shows, there are some incorrect points around the intersection point.

I want to put a red point on the lines' intersection, but it does't work.


1 Answer 1


When using MeshFunctions, it is often a good idea to reformulate your functions so that it is free of poles or other singularities:

Plot[{Tan[x], x Sin[x]}, {x, -8, 8}, 
     MeshFunctions -> {Sin[#] - # Sin[2 #]/2 &}, Mesh -> {{0}}, 
     MeshStyle -> Directive[Red, PointSize[Large]]]


Similar principles apply to the use of e.g. FindRoot[] for finding intersections.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.