## sympy – continuity test of functions

All functions I used here from Chapter 1 Exercises on Calculus and Analytic Geometry (9th Edition) by George B. Thomas, Ross L. Finney.

$y = \frac{1}{x - 2} - 3 x$
It has discontinuity at 2 of x. Smooth graph of a function means it has continuity in the given interval. Any gap or hole on a graph is discontinuous.

y1 = 1/(x - 2) - 3*x
plot(y1, (x, -2, 6), ylim=(-20, 20))


$y = \frac{x + 1}{x^{2} - 4 x + 3}$

y2 = (x + 1) / (x**2 - 4*x + 3)
plot(y2, (x, 0, 4), ylim=(-10, 10))


$y = \left\lvert{x - 1}\right\rvert + \sin{\left (x \right )}$

y17 = abs(x - 1) + sin(x)
plot(y17, (x, -5, 5), ylim=(-5, 5))


$y = \frac{1}{x} \cos{\left (x \right )}$

y19 = (cos(x))/x
plot(y19, (x, -10, 10), ylim=(-5, 5))


$y = \csc{\left (2 x \right )}$

y21 = csc(2*x)
plot(y21, (x, 0, 6), ylim=(-3, 3))


Finding limit of functions.

Can SymPy do it like Maxima does?

Find the limit of $\sin{\left (x - \sin{\left (x \right )} \right )}$ function when x approaches to Pi.

y29 = sin(x - sin(x))
limit(y29, x, pi)


The output is 0.

Find the limit of $y \sec^{2}{\left (y \right )} - \tan^{2}{\left (y \right )} - 1$ function when y approaches to 1.

y = symbols('y')
y31 = y*(sec(y))**2 - (tan(y)**2) - 1
expr1 = trigsimp(y31)


It returns $\frac{y - 1}{\cos^{2}{\left (y \right )}}$

limit(expr1, y, 1)
Out[54]: 0
sec(0)
Out[55]: 1


1 is the right answer.

Find the limit of $\cos{\left (\frac{\pi}{\sqrt{- 3 \sec{\left (2 x \right )} + 19}} \right )}$ function when x approaches to 0.

y33 = cos(pi / (sqrt(19 - 3*sec(2*x))))
limit(y33, x, 0)


The output is $\frac{\sqrt{2}}{2}$