<jupyter_start><jupyter_text>Limits<jupyter_code># Load module
from sympy import *
# Define variable
x = symbols('x')<jupyter_output><empty_output><jupyter_text>Define Function $$f(x) = \frac{x^2}{x} - 1$$<jupyter_code># Function f(x) = x^2 / x - 1
def f(x):
    return x**2 / x - 1<jupyter_output><empty_output><jupyter_text>Calculate $$\lim_{x \to 0} f(x)$$ $$=\lim_{x \to 0^+} (x-1)$$<jupyter_code># Limit of f(x)
lim = Limit(f(x), x, 0)
lim
# Do the limit
lim.doit()<jupyter_output><empty_output><jupyter_text>Define Function $$g(x) = \frac{1}{x}$$<jupyter_code># Function g(x) = 1/x
def g(x):
    return 1/x<jupyter_output><empty_output><jupyter_text>Calculate $$\lim_{x \to 0^+} g(x)$$<jupyter_code># Do the limit at positive side
limit(g(x), x, 0, '+')<jupyter_output><empty_output><jupyter_text>Calculate $$\lim_{x \to 0^-} g(x)$$<jupyter_code># Do the limit at negative side
limit(g(x), x, 0, '-')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20405982905982906, 'fraction_numerical': 0.018162393162393164, 'mean_word_length': 6.436507936507937, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '487809', 'license': 'MIT', 'n_tokens_mistral': 434, 'n_tokens_neox': 408, 'n_words': 83, 'path': 'limits.ipynb', 'repo_name': 'ricoen/learn-math', 'size': '936'}