Example: a step-by-step lesson built by Claude
A student pasted the problem below. Claude (by Anthropic, model claude-haiku-5-5) broke the solution into 4 steps and ran SymPy in a sandbox to check 3 of them. On the platform each step is a checkpoint the student must answer before the next one opens, on a mind map that grows step by step. This page shows the unedited Claude output; the interactive version loads with JavaScript.
Problem
Tìm các điểm cực trị của hàm số $y = x^3 - 3x + 2$.
Steps
Step 1: Nhận ra cách làm: cực trị nằm ở nghiệm của $y'$ và $y'$ phải đổi dấu
Checkpoint question: Để tìm cực trị của hàm số, bước đầu tiên em nên làm gì?
Result: Cần tính $y'$, giải $y'=0$, rồi xét dấu $y'$.
Step 2: Tính $y'$ và giải phương trình $y'=0$
Checkpoint question: Phương trình $y'=0$ có tổng các nghiệm bằng bao nhiêu?
Result: $y' = 3x^2 - 3 = 3(x-1)(x+1)$, nghiệm $x=-1$ và $x=1$.
from sympy import * x=symbols('x') y=x**3-3*x+2 d=diff(y,x) print(factor(d)) print(solve(d,x))SymPy output:
3*(x - 1)*(x + 1) [-1, 1]Step 3: Xét dấu $y'$ và xác định loại cực trị tại từng nghiệm
Checkpoint question: Tại $x=-1$, $y'$ đổi dấu theo chiều nào?
Result: $y'>0$ khi $x<-1$, $y'<0$ khi $-1<x<1$, $y'>0$ khi $x>1$. Tại $x=-1$ là cực đại, tại $x=1$ là cực tiểu.
from sympy import * x=symbols('x') d=3*x**2-3 print([d.subs(x,v) for v in [-2,0,2]]) print(diff(d,x).subs(x,-1), diff(d,x).subs(x,1))SymPy output:
[9, -3, 9] -6 6Step 4: Tính giá trị $y$ tại các điểm cực trị
Checkpoint question: Giá trị cực tiểu của hàm số là bao nhiêu?
Result: $y_{CĐ}=y(-1)=4$, $y_{CT}=y(1)=0$.
from sympy import * x=symbols('x') y=x**3-3*x+2 print(y.subs(x,-1), y.subs(x,1))SymPy output:
4 0
Answer
Hàm số đạt cực đại tại $x=-1$, $y_{CĐ}=4$ (điểm $(-1;4)$); đạt cực tiểu tại $x=1$, $y_{CT}=0$ (điểm $(1;0)$). (checked with SymPy)