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

Click For Summary
Mathematica can automatically handle the ratio of functions f1(x) / f2(x) with common zeros by switching to f1'(x) / f2'(x) to avoid indeterminate forms like 0/0 during plotting. Users have noted that while the software effectively manages this during visualizations, it still produces errors when calculating specific values at singular points. The discussion highlights the need for a robust method to handle these singularities without errors. Overall, Mathematica's automatic handling of function ratios is beneficial for plotting, but caution is needed for precise calculations at points of discontinuity.
Swamp Thing
Insights Author
Messages
1,045
Reaction score
775
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 Dale

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
Replies
1
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 7 ·
Replies
7
Views
11K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K