# Plot real and imaginary part of function

I have the following function:

f3 = (99. (2154.43 - 100. lh^2.))/lh^1. - (0.0609773 ((2154.43 - 100.lh^2.)/lh^1.)^7.30317)/(-4.64159 - lh)^6.30317

If I plot it, in that specific interval, I get:

Plot[{f3}, {lh, 4.45, 4.85}]

If instead I plot both the real and the imaginary part I get:

Plot[{Re[f3], Im[f3]}, {lh, 4.45, 4.85}, PlotTheme -> "Detailed"

I don't understand why when I plot only the real part, the function is not shown for values smaller than 4.64. Indeed, the imaginary part is not zero for values greater than 4.64 either, as is shown in the following graph:

Plot[{Im[f3]}, {lh, 4.78, 4.8}, PlotTheme -> "Detailed"]

• Plot[{f3}, {lh, 4.45, 4.85}] only plots if the argument f3 is real! Only forx>4.64 the imaginary part of f3 vanishs! – Ulrich Neumann Nov 7 '18 at 11:36
• Does this mean that there is a threshold regarding the imaginary part of a complex number, below which M. treats it as a Real number? – Tecon Nov 7 '18 at 11:40
• No I don't think so. Plot only tries to find the region where f3 is real. That's why for example Plot[Exp[I x],{x,0,2 Pi}] gives no output! – Ulrich Neumann Nov 7 '18 at 11:46
• Plot is a numerical(!) function. Values smaller 10^-13(depending on the WorkingPrecision) are assumed to be zero! – Ulrich Neumann Nov 7 '18 at 12:22
• You are encountering precision issues that result from doing calculations using machine precision. To get precise calculations you need to track and control precision by using exact or arbitrary-precision numbers. To avoid conflicts with subsequent specification of desired working precision, start by expressing f3 with exact numbers by using Rationalize. – Bob Hanlon Nov 8 '18 at 4:57