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

  • Context: Mathematica 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Apply Functions Ratio
Click For Summary
SUMMARY

The discussion centers on the use of Mathematica for plotting the ratio of two functions, f1(x) and f2(x), that share common zeros. Users noted that Mathematica automatically applies l'Hospital's rule by switching to the derivatives f1'(x) and f2'(x) when encountering indeterminate forms, thus optimizing numerical precision. However, while the software effectively avoids 0/0 errors during plotting, it still produces errors when calculating specific values at singularities.

PREREQUISITES
  • Familiarity with Mathematica 12.3 for function plotting
  • Understanding of l'Hospital's rule in calculus
  • Knowledge of numerical precision and floating-point errors
  • Basic concepts of derivatives in mathematical functions
NEXT STEPS
  • Explore Mathematica's function plotting capabilities in detail
  • Learn about implementing custom error handling for singularities in Mathematica
  • Study the application of l'Hospital's rule in computational software
  • Investigate techniques for optimizing numerical precision in mathematical computations
USEFUL FOR

Mathematics students, software developers using Mathematica, and anyone interested in advanced function analysis and numerical methods.

Swamp Thing
Insights Author
Messages
1,048
Reaction score
799
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

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 2 ·
Replies
2
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K