import React, { useRef, useState, useEffect } from "react"; import { ArrowDown, Check, BookOpen, Scale, ArrowRight, RotateCcw, } from "lucide-react"; import LinearSolutionsWidget from "../../../components/lessons/LinearSolutionsWidget"; import Quiz from "../../../components/lessons/Quiz"; import { LINEAR_EQ_QUIZ_DATA } from "../../../utils/constants"; import { Frac } from "../../../components/Math"; interface LessonProps { onFinish?: () => void; } const BalanceScaleWidget = () => { const [left, setLeft] = useState(15); const [right, setRight] = useState(15); const [tilt, setTilt] = useState(0); const [message, setMessage] = useState("Balanced"); const apply = (val: number, side: "both" | "left" | "right") => { let newLeft = left; let newRight = right; if (side === "left" || side === "both") newLeft += val; if (side === "right" || side === "both") newRight += val; setLeft(newLeft); setRight(newRight); if (newLeft === newRight) { setTilt(0); setMessage("Perfectly Balanced! ✅"); } else if (newLeft > newRight) { setTilt(-15); setMessage("Unbalanced! Left side is heavier. ❌"); } else { setTilt(15); setMessage("Unbalanced! Right side is heavier. ❌"); } }; const reset = () => { setLeft(15); setRight(15); setTilt(0); setMessage("Balanced"); }; return (

Algebra Balance Scale

{left} kg
{right} kg
{message}

Goal: Keep the scale balanced while isolating the variable.

); }; const LinearEquationsLesson: React.FC = ({ onFinish }) => { const [activeSection, setActiveSection] = useState(0); const sectionsRef = useRef<(HTMLElement | null)[]>([]); const scrollToSection = (index: number) => { setActiveSection(index); sectionsRef.current[index]?.scrollIntoView({ behavior: "smooth", block: "start", }); }; useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { const index = sectionsRef.current.indexOf( entry.target as HTMLElement, ); if (index !== -1) setActiveSection(index); } }); }, { rootMargin: "-20% 0px -60% 0px" }, ); sectionsRef.current.forEach((section) => { if (section) observer.observe(section); }); return () => observer.disconnect(); }, []); const SectionMarker = ({ index, title, icon: Icon, }: { index: number; title: string; icon: any; }) => { const isActive = activeSection === index; const isPast = activeSection > index; return ( ); }; return (
{/* Section 1: Balance Principle */}
{ sectionsRef.current[0] = el; }} className="min-h-screen flex flex-col justify-center mb-24 pt-20 lg:pt-0" >

The Balance Principle

Linear equations are like a balance scale. Whatever you do to one side, you must do to the other. The goal is always to isolate the variable — get x by itself on one side with a number on the other.

{/* 4-Step Process */}

The 4-Step Solve Process

{[ { step: "1", title: "Distribute", desc: "Expand parentheses and clear fractions by multiplying through by the LCD (lowest common denominator).", }, { step: "2", title: "Combine Like Terms", desc: "Simplify each side of the equation separately — add/subtract terms with the same variable.", }, { step: "3", title: "Move", desc: "Get all variable terms on one side, all constant terms on the other, using addition or subtraction.", }, { step: "4", title: "Divide", desc: "Divide both sides by the coefficient of the variable to solve.", }, ].map((item) => (
{item.step}

{item.title}

{item.desc}

))}
{/* Three Worked Examples */}

Example 1: Basic (no fractions)

Solve: 3(2x − 4) = 2x + 8

Step 1 (Distribute): 6x − 12 = 2x + 8

Step 3 (Move): 4x = 20

Step 4 (Divide by 4):{" "} x = 5

Example 2: With fractions — clear them first!

Solve: + 2 = − 1

Multiply every term by 6 (LCD of 3 and 2):

2x + 12 = 3x − 6

12 + 6 = 3x − 2x

x = 18

Example 3: Literal equations (isolating a variable)

Solve for r: A = P(1 + rt)

Divide both sides by P: = 1 + rt

Subtract 1: − 1 = rt

Divide by t:{" "} r ={" "} − 1 } d="t" />

Common SAT Mistake: Distributing a Negative

When distributing a negative sign: −3(x − 4) = −3x + 12, NOT −3x − 12. The negative multiplies EVERY term inside the parentheses.

{/* Section 2: Number of Solutions */}
{ sectionsRef.current[1] = el; }} className="min-h-screen flex flex-col justify-center mb-24" >

One, None, or Infinite Solutions?

Not all equations have exactly one answer. After simplifying, look at what's left. The SAT frequently asks for a value of k{" "} that makes an equation have no solution or infinitely many solutions — this is a critical concept to master.

The Three Outcomes

One Solution
2x + 1 = x + 5
Variable survives after simplification → unique answer:{" "} x = 4
No Solution
2x + 3 = 2x + 5
Variables cancel → 3 = 5 (false statement — impossible)
Infinite Solutions
2x + 3 = 2x + 3
Variables cancel → 3 = 3 (always true — every x works)
{/* Finding k */}

SAT Focus: Finding the Value of k

Example: For what value of k does 4x + k = 4x − 2 have no solution?

After subtracting 4x from both sides: k = −2

If k = −2: −2 = −2 (always true) → infinite solutions, not no solution!

For no solution: k ≠ −2 (any other value gives a false statement like k = −2 being false)

The equation has no solution for any value of k EXCEPT −2. For infinite solutions, set k = −2.

Example: For what value of k does 3(x + k) = 3x + 12 have infinite solutions?

Distribute: 3x + 3k = 3x + 12

Subtract 3x: 3k = 12

k = 4

For k = 4: 12 = 12 (always true) → infinite solutions. ✓

The Key Rule

No solution: same variable coefficients, different constants (parallel lines).
Infinite solutions: same variable coefficients AND same constants (identical lines).

{/* Section 3: Quiz */}
{ sectionsRef.current[2] = el; }} className="min-h-screen flex flex-col justify-center" >

Practice Time

{LINEAR_EQ_QUIZ_DATA.map((quiz) => (
))}

Topic Mastered!

); }; export default LinearEquationsLesson;