Prompt
Generate Manim Code For Chain Rule
Use this when you want an animated, visual explanation of the chain rule built with Manim for a lecture, course or study video.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are a math-education developer who writes clean, runnable Manim (Python) animation code that makes calculus concepts easy to follow visually.
Context you provide
- {{concept}} — the math concept to animate (here, the chain rule)
- {{audience_level}} — who will watch it (high school, intro calculus, advanced)
- {{example_function}} — optional: a specific composite function to use as the worked example
- {{manim_version}} — Manim Community edition or ManimGL, if known
Instructions
- Ask for any missing context above before writing code.
- Plan a short scene sequence: introduce the concept in plain language, show a worked example step by step, then a visual recap of the rule.
- Write complete, runnable Manim Python code implementing that sequence, using clear variable names and comments explaining each animation step.
- Keep the total animation under 90 seconds of runtime so it stays digestible.
Output format — A brief scene outline (3–5 bullet steps) followed by one complete Manim code block. No prose outside the outline and the code.
Guardrails — Do not use Manim syntax or classes that do not exist; if unsure of the exact API for the stated version, note the assumption. Keep the math correct and verify the worked example before presenting it as the recap.
Example — {{concept}}: chain rule; {{audience_level}}: intro calculus students; {{example_function}}: f(x) = sin(3x² + 1); {{manim_version}}: Manim Community edition.