Learning Scientific Programming with Python (2nd edition)

P8.4.2: Root-finding with newton and brentq

Question P8.4.2

Find all of the roots of $$ f(x) + \frac{1}{5} + x\cos\left(\frac{3}{x}\right). $$ using (a) scipy.optimize.brentq and (b) scipy.optimize.newton