Ratio of functions -- automatically apply l'Hospital rule when needed

  • Topic: Mathematica 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Apply Functions Ratio
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 1K views
Swamp Thing
Insights Author
Messages
1,075
Reaction score
841
I want to plot the ratio f1(x) / f2(x), where they have some common zeros. Does Mathematica have a feature that will do this, switching automatically to f1'(x) / f2'(x) when appropriate, avoiding F.P. errors and optimizing numerical precision?

If not, is there a good way to implement this?
 
Physics news on Phys.org
After posting, I thought I'd just try it in the normal way and see what happens... it seems to be doing it automatically anyway, without specifying any feature.

Edit:
It avoids the 0/0 while plotting, but it gives an error when you calculate a single value at the singularity.
 
Last edited:
  • Like
Likes   Reactions: Dale