You will write three functions that test a limit by a series and by L'Hôpital's rule. The checker uses and .
The idea. The sine series is . Three terms are enough to see that is close to for small . L'Hôpital's rule replaces by , so you can try the ratio of derivatives near the point.
Your tasks.
sin_series(x, terms). Return the sum of the first terms terms of the sine series.ratio_by_series(x). Return (x - sin_series(x, 3)) / x ** 3.lhopital_ratio(fp, gp, x). Return fp(x) / gp(x), the ratio of the two derivatives given as functions.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…