Explainer

Worked answers to your doubts, typeset the way moodle 2 renders them, math and diagrams included. New entries stack on top.

Building the Q2(a) square-wave graph from absolute zero, every step

Goal: start from a blank page and end at the app’s graph, with no step assumed. The function is the one from Q2(a):

h(t)= { 10<t<π 0π<t<2π

Step 0: what a graph even is

A graph is a lookup table drawn as a picture. The horizontal axis is the floor: every position on it is a time t. The vertical axis is the wall: every position on it is a height. A point drawn at floor-position t and wall-height y is the statement “at time t, the function’s value is y”. Drawing the whole graph means doing that for every time at once.

Before drawing anything, mark the landmark times the brace mentions. π is just the number 3.14…, so the landmarks are 0, π3.14, and 2π6.28:

t (time, the floor) h (height, the wall) 1 0 π ≈ 3.14 ≈ 6.28
Step 0: bare axes plus the three landmark times the brace names, and the height 1 marked on the wall.

Step 1: draw the first line of the brace

Line one says: for every time between 0 and π, the height is 1. Pick any such time and plot its point: at t=1, height 1. At t=2, height 1. At t=0.5, height 1. Every single point lands at the SAME height, so joining them gives a flat shelf at height 1 running from t=0 to t=π:

1 t = 1 t = 2 every t in (0, π) plots at height 1 0 π
Step 1: line one of the brace becomes a flat shelf at height 1, because every time in (0, π) gets the same answer.

Step 2: draw the second line, height 0 lies ON the axis

Line two says: for every time between π and 2π, the height is 0. Height zero is not “nothing drawn”, it is a real shelf that happens to sit at the level of the floor itself. So the graph between π and 2π is a flat segment lying exactly ON the t-axis. This is why the app’s picture looks like the wave “disappears” there: it has not disappeared, it is at height 0.

At t=π itself, the value jumps: just left of π the height is 1, just right of it the height is 0. Nothing is drawn vertically at the jump, a function has exactly one value per time, so there is no wall connecting the shelves. The dashed vertical in the app is only a visual guide marking where the teleport happens. (Fine print: the brace uses strict < signs, so at exactly t=π it does not define a value at all; for Fourier purposes the series will later converge to the midpoint ½ there.)

1 jump: 1 → 0 (no wall drawn) height 0 = lying on the axis 0 π
Step 2: the zero shelf drawn ON the axis (thickened here so you can see it), with the jump at π. One full period, the window (0, 2π), is now complete.

The window we have drawn runs from 0 to 2π, length 2π. That length is the period: T=2π, hence ω=2πT=1 rad/s.

Step 3: photocopy the block both ways forever

“Periodic” means h(t+2π)=h(t): shift the picture by one period and it must look identical. So stamp the Step-2 block at every shift of 2π. Shift right: shelf at 1 on (2π,3π), zero on (3π,4π). Shift left: shelf at 1 on (2π,π), zero on (π,0):

−2π −π 0 π the Step-2 block copy +2π copy −2π …and so on, both ways, forever
Step 3: the block stamped every 2π. Equal widths: π up, π down, jumps at every multiple of π. This IS the app’s graph.

Step 4: verify against the app’s picture

  • 1Just right of 0: shelf at 1, width π. Matches (the app’s hump from 0 to π). ✓
  • 2Just LEFT of 0: the app shows the wave on the axis from −π to 0. Our copy rule predicts exactly that: (π,0) is the zero shelf of the left-shifted block. ✓
  • 3Spot values: h(π/2)=1 (inside the first hump), h(3π/2)=0 (on the zero shelf), matching the earlier reading-a-value entry. ✓

Contrast with Q2(b) below: same recipe exactly (draw the brace once, tile by the period), only the ingredients differ, Q2(b)’s shelves are −1 and +1 with unequal widths and the stamp distance is 3 instead of 2π. Master the recipe once and every “sketch over a few periods” question is the same two moves.

If my sketch is wrong, can I still get the Fourier series marks?

Yes, almost all of them, because the series is computed from the BRACE (the piecewise definition), not from your drawing. But there is exactly one pipe connecting the two, and if you use it carelessly a bad graph can poison the algebra. Know where that pipe is.

What each part is actually marked on

  • 1The sketch marks are their own little pot: axes, correct widths and heights, a few periods shown. Lose these and they are gone, but they are only the sketch’s pot.
  • 2The series marks come from: correct T and ω=2π/T, correctly split integrals with the right limits and the right constant in each piece, correct integration, correct assembly. Every one of those reads straight off the brace: for Q2(b), bn=23[20(1)sin(nωt)dt+01(+1)sin(nωt)dt]. No picture required anywhere in that.
the brace piecewise definition sketch its own marks integrals a₀, aₙ, bₙ series marks ✓ the ONLY pipe: a symmetry claim
The series marks flow from the brace through the integrals. The sketch is a side pot, EXCEPT the dashed pipe: declaring “odd” or “even” off a wrong graph and using it to delete coefficients.

The one way a bad graph poisons the series

The symmetry shortcut. If your (wrong) sketch convinces you the wave is odd, you will write “odd, so a0=an=0” and skip two integrals. If the wave is actually “neither” (as in Q2(b)), you have now thrown away real, non-zero coefficients, and the final series is wrong for a reason that traces straight back to the graph.

The safe play when unsure of your sketch

  • Don’t claim a symmetry you can’t verify from the brace. The algebraic test (compare h(−t) with ±h(t) using the piecewise rule, not the picture) is sketch-proof.
  • If in any doubt, compute all three coefficients from the brace. Costs a few minutes, immune to drawing errors, and every correct integral earns its marks even if the sketch above it is nonsense.
  • Use the graph only for free CHECKS, never as an input: the DC term should match the eyeballed average, and coefficients should decay like 1/n for a jumpy wave. If they disagree, something is wrong somewhere, which is information, not marks lost.

Bottom line for Q2(b): a mangled sketch costs you the sketch’s own couple of marks and nothing else, PROVIDED your series work starts from the brace and you only state “neither odd nor even” if the algebra (or the widths in the brace: 1 vs 2) backs it.

How the ±1 square wave graph (period 3) was drawn from the brace

The question hands you a piecewise rule for ONE period and expects you to turn it into a repeating graph. There are exactly two steps: (1) draw literally what the brace says, once; (2) photocopy that block left and right forever. Here is each step slowly.

Step 1: read the brace, draw one block

The rule is:

h(t)= { 12<t<0 +10<t<1

Read each line as “flat shelf at this height, over this stretch of floor”: a shelf at height 1 from t=2 to t=0 (width 2), then a shelf at height +1 from t=0 to t=1 (width 1). Together they cover 2<t<1, a window of total length 3. That length IS the period: T=1(2)=3, so ω=2π3 rad/s.

t −2 0 1 h = −1, width 2 h = +1, width 1 one period: length 3 → T = 3
Step 1: draw exactly what the brace says, two flat shelves. Note the asymmetry: the low shelf is twice as wide as the high one.

Step 2: photocopy the block every 3 units

“Periodic with period 3” means h(t+3)=h(t): slide the whole picture 3 to the right (or left) and it must look identical. So take the block from Step 1 and stamp copies at every shift of 3:

−2 0 1 3 4 the Step-1 block copy, shifted +3 copy, shifted −3
Step 2: tile the block along the axis, every 3 units. The pattern that emerges is exactly the app’s graph: wide low shelves, narrow high shelves, jumps at …, −2, 0, 1, 3, 4, 6, …

Where each feature of the final graph comes from:

  • 1Narrow tops, wide bottoms: straight from the brace, the +1 piece is width 1, the 1 piece is width 2. (A one-third duty cycle.)
  • 2Jump locations: the block’s internal jump at t=0 and its seams at 2 and 1, then all of these repeated every 3: …, −2, 0, 1, 3, 4, 6, 7, …
  • 3Dashed verticals: not part of the function, just guides marking the instant the value teleports between −1 and +1. A function can only have one value per t, so the jump has no “vertical wall”.

Why the graph shows “neither odd nor even” at a glance

The widths give it away. Mirror the graph in the vertical axis: just right of 0 the wave is +1 for a width-1 stretch, but just left of 0 it is 1, so it is not even. For oddness, beware: near the origin it LOOKS odd (heights flip across 0). Test one point further out: h(1.5)=1 (in the (1,3) low shelf) but h(1.5)=(1)=+1. Not equal, so not odd. The unequal widths (1 vs 2) are what break both symmetries.

Lesson inside the lesson: a symmetry test that PASSES at one point proves nothing, symmetry must hold everywhere, and this wave passes the odd test near 0 yet fails it at 1.5. One failing point disproves; one passing point does not prove.

Bonus: what the graph already tells you about the series

Mean value by areas: over one period, area =(2×(1))+(1×(+1))=1, divided by the width 3 gives the DC term 13. The wave spends more time low than high, so its average sits below zero, and with no symmetry, expect both an and bn to survive in the series.

In “add f(t) to both sides”, how does 2f(t) = 0 appear?

This is from the both-odd-and-even proof below: we reached f(t)=f(t) and then “added f(t) to both sides” to get 2f(t)=0. The confusion: it can look like we claimed f(t)+f(t)=f(t). We did not. The two sides get the same treatment but produce different results.

Watch each side separately

Adding the same thing to both sides of an equation keeps it true. Do it and simplify each side on its own:

f(t)+f(t) left: two of the same → 2f(t) = f(t)+f(t) right: a thing plus its negative → 0
  • LLeft side: it was f(t), we add f(t), and two copies of the same thing is twice the thing: 2f(t). This is where the 2 comes from.
  • RRight side: it was f(t), we add f(t), and anything plus its own negative cancels to 0. This is where the 0 comes from. (Never f(t): that would be 1+1=1, which is false.)
2f(t)=0 f(t)=0

Same move with a plain x

If the f(t) clutter is the problem, rename it: let x=f(t), one unknown number. The proof line is then just ordinary equation-solving:

x=x x+x=x+x 2x=0 x=0

Sanity check with a number: could x=5 satisfy x=x? That would need 5 = −5, false. Could x=0? 0 = −0 is true. Zero is the only number equal to its own negative, which is exactly what the algebra concluded, and (applied at every t) why the only both-odd-and-even function is the zero function.

Can a function be both odd AND even?

Yes, but only one function in all of mathematics pulls it off: the zero function, f(t)=0 for every t (the flat line lying exactly on the horizontal axis). Nothing else qualifies. Here is why.

The proof: force both rules at once

Suppose some function f is BOTH. Then it must obey both defining equations at the same time:

even says:  f(t)=f(t) odd says:  f(t)=f(t)

Both equations describe the SAME quantity f(t) on their left, so their right-hand sides must be equal to each other:

f(t) = f(t)

Now add f(t) to both sides:

2f(t)=0 f(t)=0

And this holds for every t. So the only way to be both is to be zero everywhere. The single number that is its own negative is 0, and a function that must equal its own negative at every point has no choice but to be flat zero.

The picture: the one shape both symmetries allow

The flat line on the axis is the only graph that survives BOTH symmetry operations. Mirror it left-to-right, unchanged. Spin it 180° about the origin, still unchanged. Any bump anywhere would break one of the two.

t f(t) = 0 mirror → same  ·  spin 180° → same
f(t) = 0 is mirror-symmetric (even) and rotation-symmetric (odd) at once, the unique function in the overlap of the two categories.

The takeaway on the three labels

  • 1“Odd” and “even” are NOT opposites. Most functions are neither (like our square wave), some are one, and exactly one, f=0, is both.
  • 2So “both” is a real but trivial case. If a symmetry argument ever forces your function to be both odd and even, it is telling you the function is identically zero, sometimes a useful sanity check that a coefficient must vanish.

Our unit square wave is nowhere near this: it sits at 1 half the time, so it is not the zero function, and (as shown in the entries below) it is neither odd nor even.

How we concluded the square wave is neither odd nor even: both tests, in full

“Odd” and “even” are two specific kinds of symmetry a graph can have. A function can be one, the other, or neither. To decide, you run two tests. If both fail, the verdict is “neither”, which is what happened here.

What the two symmetries look like

Before testing, picture what you are testing FOR. These are the only two special mirrors that matter:

EVEN mirror in the vertical axis ODD spin 180° about the origin
EVEN (blue): the left half is the mirror image of the right half. ODD (orange): rotate the whole graph half a turn about the centre and it lands on itself, so equal-distance points sit at opposite heights.

In symbols, comparing the height at t with the height at t:

EVEN:  h(t)=h(t) ODD:  h(t)=h(t)

The two heights we already know

From reading the wave earlier, we have a value and its mirror-partner:

  • +h(π2)=1  (that time is in the ON block)
  • h(π2)=0  (its mirror lands in the OFF block)

To DISPROVE a symmetry you only need one place where it fails, so this single pair of heights is enough to settle both tests.

Test 1 — is it EVEN?

Even demands h(t)=h(t). Put our two heights in:

h(π2)0 = h(π2)1 0=1? NO.

0 is not 1, so the even equation is false. Not even.

Test 2 — is it ODD?

Odd demands h(t)=h(t). That would need h(π/2) to equal 1:

h(π2)0 = h(π2)1 0=1? NO.

0 is not 1, so the odd equation is false too. Not odd.

Verdict

Even test: failed. Odd test: failed. A function that is neither even nor odd is called, simply, neither. That is the conclusion.

Two ways to see it instantly, no test point needed

  • 1Can’t be odd: an odd graph must dip below the axis (every positive bit needs a matching negative bit rotated through the origin). This wave only ever sits at 0 or 1, never negative, so odd is impossible on sight.
  • 2Can’t be even: even means a left/right mirror about the vertical axis. The ON block sits to the RIGHT of 0 with nothing mirroring it on the left (that side is OFF), so the picture isn’t mirror-symmetric.

Why we bothered checking

Symmetry is a shortcut: an even function needs only cosine terms, an odd function only sine terms, and either one kills half the coefficients before you integrate. “Neither” means no free lunch from symmetry directly, BUT this wave is secretly (odd wave) + (constant), so once you subtract its mean it becomes odd, and the series is a DC term plus sines only. That is why checking symmetry first, even when the answer is “neither”, still pays off.

Is the 2 in π/2 arbitrary? Numbers you choose vs numbers the maths forces

Short answer: yes, that particular 2 is arbitrary. But this is worth pinning down properly, because a maths page is full of numbers and some are free choices while others are locked by the problem. Telling them apart stops a lot of confusion.

The 2 in π/2 was MY choice (a test point)

Remember where π/2 came from: to check whether the square wave was odd or even, I needed to pick some time and read the wave’s height there and at its mirror. I picked π/2. Nothing forced that. I just wanted a convenient spot sitting safely inside the ON block (0,π), away from the jumps at the edges. Any time in that block would have done the job:

ON (height 1) OFF (height 0) π/4 1 π/2 2 0 π any of these test points works
π/2, 1, π/4, 2, all sit in the ON block, so any of them tests the symmetry equally well. π/2 just happens to be a tidy one.

To prove it is free, redo the whole odd/even test with t = 1 instead:

  • 11 is in the ON block (since 1<π3.14), so h(1)=1.
  • 2Its mirror: h(1)=h(1+2π)=h(5.28)=0 (OFF block).
  • 310 and 10, so “neither odd nor even.” Same verdict as π/2 gave.

The conclusion did not depend on the number I picked, which is exactly what “arbitrary” means here.

But most 2’s in Fourier are NOT free, they are forced

Do not carry the “it’s just a number” lesson too far. The other 2’s floating around this topic are locked by the maths and cannot be changed:

  • πThe 2 in ω=2πT: forced. It is there because one full turn of a circle is 2π radians. Change it and ω is simply wrong.
  • ½The 2 in the DC term a02 and the 2T in every coefficient: forced. They fall out of the orthogonality integrals (a sin2 or cos2 averages to T/2 over a period). That T/2 is what the 2T cancels.

The rule of thumb

  • ?Ask: if I swapped this number, would the answer still be right?
  • Yes → it was a free CHOICE (a test point, a convenient limit of integration, a sample value). Pick whatever is easiest.
  • No → it is FORCED by a definition or an identity (a full circle is 2π, orthogonality gives T/2). Do not touch it.

So: the 2 in the test point π/2 is a free choice, and swapping it for 1 or π/4 changes nothing. The 2 in ω = 2π/T and in a₀/2 is forced, and swapping it breaks the maths. Both are “a 2”, but they are doing completely different jobs.

How do I get h(π/2) = 1? Reading a wave’s value at a point, slowly

No trig, no integration here. This is just: you are handed a time, and you have to read off the wave’s height at that time. We go one tiny step at a time.

First: what does “h(t)” even mean?

Think of h as a machine. You feed it a time, it gives you back a height. That is all the notation h(t) means: “the height of the wave at time t.”

So what is h on its own? It is simply the name of the wave, the way a person is named Tom. h by itself is not a number, it is the whole rule/shape. The letter is arbitrary (could be f, g, v); here it is h, handy for height. When you bolt a time onto it, h(1.57), THAT is a number: the height the wave named h reaches at that time.

h the rule (a lookup) put in a time e.g. t = 1.57 get a height either 1 or 0
“h(π/2)” means: put the time π/2 into the machine, read the height that comes out.

Wait — π/2 is horizontal, 1 is vertical. How can they be equal?

They are not equal, and this is the single most important thing to get straight. h(π/2)=1 is NOT saying “π/2 is the same as 1.” They live on two different axes and never get compared:

  • π/2 is a horizontal thing: a time, a spot along the floor. It answers “how far along?”
  • 1 is a vertical thing: a height, how tall the wave stands. It answers “how high?”

The machine h is the bridge between the two: you hand it a floor-position (the time), and it hands back a height. So h(π/2)=1 reads: “at the floor-position π/2, the wave is standing 1 tall.” The left side is a height, that is why the answer is a height.

horizontal axis = TIME (the floor) “how far along?” vertical axis = HEIGHT (the wall) the wave π/2 1 1. start at the time,    go straight UP 2. read the height across
The two axes are different questions. You enter from the floor (a time, π/2) and read the answer up the wall (a height, 1). The orange arrow up and green arrow across are the two halves of one lookup, they are never “equal” to each other.

Analogy: a car’s speedometer. “At 3 o’clock the speed was 50 mph” does not mean 3 = 50. The 3 is a time, the 50 is a speed; the speedometer links them. Same here: the time π/2 and the height 1 are different kinds of thing, and h is what links them.

Second: this machine’s rule is a light switch on a timer

Our wave’s rule has just two settings. Written out, it says:

  • 1For any time between 0 and π  →  the height is 1 (switch ON).
  • 2For any time between π and 2π  →  the height is 0 (switch OFF).

Here is that rule drawn on a timeline. The blue stretch is where the height is 1, the grey stretch is where it is 0:

height = 1 (ON) height = 0 (OFF) 0 π (≈ 3.14) (≈ 6.28)
The wave’s whole rule for one period: ON (height 1) from 0 to π, OFF (height 0) from π to 2π.

Third: turn π/2 into a normal number

π is just a number, about 3.14. So π/2 means 3.14 shared into 2, which is about 1.57. Nothing more mysterious than that:

π2 = 3.142 1.57

So the question “what is h(π/2)?” is really just “what is the height at time 1.57?

Fourth: find where 1.57 sits on the timeline

Put 1.57 on the same timeline. Is it in the blue (ON) stretch or the grey (OFF) stretch? The ON stretch runs 0 to 3.14, and 1.57 is smaller than 3.14, so it lands inside the blue stretch, roughly in the middle of it:

ON (height 1) OFF (height 0) 0 π ≈ 3.14 2π ≈ 6.28 time 1.57 is here inside the ON stretch ✓
1.57 is less than 3.14, so it falls in the blue ON stretch. That single fact decides the answer.

Fifth: read off the height for that stretch

The blue stretch has height 1 everywhere. Time 1.57 is in the blue stretch. So the height at 1.57 is 1. Drawn on the actual wave, you go up from 1.57 on the bottom axis until you hit the wave, and you hit it at height 1:

t 1 0 1.57 (= π/2) meets the wave at height 1 π
Go up from 1.57 until you touch the wave. You meet it at height 1. That is what h(π/2) = 1 is saying.
h(π2) = h(1.57) = 1

Do it once more, so it sticks: h(3π/2)

Same four steps. Turn it into a number: 3π/2 is 3×3.14/24.71. Where does 4.71 sit? It is bigger than 3.14, so it is past π, in the grey OFF stretch (3.14 to 6.28). The grey stretch has height 0. So:

h(3π2) = h(4.71) = 0

That is the exact value used for h(−π/2) in the odd/even test: −π/2 is the same spot as 3π/2 once you slide over by one full period, and both read 0.

The whole thing in one sentence

  • Turn the time into a plain number.
  • See which stretch (ON or OFF) that number falls in.
  • Read off that stretch’s height. Done.

There is genuinely no calculation, it is a lookup. The wave only ever sits at 1 or 0, and which one you get depends only on whether your time landed before π or after it.

The unit square wave: testing odd/even/neither, and what the DC term really is

The setup: one period of the signal is h(t)=1 on 0<t<π and h(t)=0 on π<t<2π, repeated forever. A switch that is ON half the time, OFF half the time. Period T=2π, so ω=2πT=1 rad/s.

t mean = ½ h(π/2) = 1 h(−π/2) = 0 0 π −π 1
The wave, its mean level ½ (dashed), and the two test points used below: same distance from zero, different heights, so no symmetry.

Part 1: odd, even, or neither, tested properly

The definitions are about comparing the function at t and at t:

even: h(t)=h(t) odd: h(t)=h(t)

Geometrically: even means the graph is a mirror image in the vertical axis; odd means the graph is unchanged by a 180° rotation about the origin. To DISPROVE a symmetry you only need one point where it fails, so the practical test is: pick a convenient t, read the height there and at t, compare.

Take t=π2. From the graph, h(π2)=1 (inside the ON block). For the height at π2, use periodicity, shifting by one whole period changes nothing:

h(π2) = h(π2+2π) = h(3π2) =0

because 3π2 lies in the OFF block (π,2π). Now run both tests at this one point:

  • 1Even test: is h(t)=h(t)?  Here 01. Fails. Not even.
  • 2Odd test: is h(t)=h(t)?  Here 01. Fails. Not odd.

Both symmetries fail, so the wave is neither. There is also a faster argument against oddness that needs no point at all: an odd function must take the value h(t) whenever it takes h(t), i.e. it needs matching NEGATIVE values. This wave only ever equals 0 or 1, it never goes below the axis, so it cannot possibly be odd.

The hidden symmetry: "neither" here means "odd plus an offset"

Here is the insight that explains the final answer before you compute anything. The wave itself has no symmetry, but subtract its average height 12 and look at what is left:

t −½ ½ −½ π −π
f(t) − ½ is a ±½ square wave: rotate it 180° about the origin and it lands on itself. The two marked points (equal distances, opposite heights) show the odd symmetry the original wave was hiding.

h(t)12 is a ±12 square wave, and THAT function is genuinely odd. So the signal is really (odd function) + (constant). Odd functions expand in sines only, constants are the DC term, and that is the entire structure of the answer: a constant 12 plus sines, with every an destined to be zero. The calculation below just confirms it.

Part 2: what the DC term is

"DC" is borrowed from electronics: direct current, the steady, zero-frequency part of a signal, what a battery supplies, as opposed to the wiggling AC part. In a Fourier series the DC term is the constant out front, and it always equals the mean value of the signal over one period:

DC term = a02 = 1T 0T f(t)dt = area under one periodwidth of one period

You can see the answer with no integration: the wave is at height 1 for exactly half of every period and at 0 for the other half, so its average height is 12. That is the dashed line in the first figure, the level the wave "balances" around. Now the formula version, which is what the tutorial writes:

a0 = 2T 0T f(t)dt = 1π 0π 1dt = ππ =1 a02 = 12
  • 1The integral shrank from (0,2π) to (0,π) because the function is ZERO on the second half, integrating 0 adds nothing.
  • 2Watch the factor of two: the course convention writes the constant as a02, so a0=1 but the DC level is 12. Writing 1 as the constant term is THE classic lost mark.
  • 3Engineering check: this is a 50% duty-cycle switch on a 1 V rail, and its DC level is duty × amplitude = ½. The same idea runs PWM in Power Electronics: vary the duty cycle and you vary the DC you deliver.

Part 3: the remaining coefficients, briefly

The cosine coefficients die because sin(nπ)=0 at both limits (as the hidden-odd argument predicted):

an = 1π 0π cos(nt)dt = sin(nπ)nπ =0

The sine coefficients survive, split by the cos(nπ)=(1)n even/odd flip (see the entry below on exactly this):

bn = 1π 0π sin(nt)dt = 1cos(nπ)nπ = { 0 n even 2nπ n odd

Assemble constant + surviving sines:

f(t) = 12 + 2π ( sint + 13sin3t + 15sin5t + )

Read the answer back against the structure we predicted: the 12 is the DC term (the mean), and everything else is sines because the wave minus its mean is odd. Only odd harmonics appear (1st, 3rd, 5th…), the coefficients decay like 1n because the wave has jumps, and at each jump the series converges to the midpoint 12, which is, once again, the DC level.

Where does the ±π/n come from in −π cos(nπ)/n?

The whole split is powered by one fact: cos(nπ) is always either +1 or −1, flipping as n steps through the integers. Plug those two values into πcos(nπ)n and you get the two cases.

Step 1: cos(nπ) lands only on ±1

Walk the cosine graph at whole multiples of π. Every step of π is half a wavelength, so you jump from one peak straight to the opposite one:

cos(0)=1 cos(π)=1 cos(2π)=1 cos(3π)=1

Even n gives +1, odd n gives 1. That is exactly what the compact identity says:

cos(nπ) = (1)n

Step 2: substitute each value

Everything except the cosine, the πn, just rides along. Only the cos(nπ) changes sign:

  • En even, cos(nπ)=+1:  πn·(+1)=πn
  • On odd, cos(nπ)=1:  πn·(1)=+πn

The odd case is the one to watch: the two minus signs cancel (the leading times the 1 from the cosine), flipping the result positive. That sign flip is the entire content of the brace:

πcos(nπ)n = { πn n even +πn n odd

The one-line version

You do not have to write a brace at all. Because cos(nπ)=(1)n, the same result folds into a single alternating term:

πcos(nπ)n = π(1)nn = π(1)n+1n

The bumped exponent, n+1 instead of n, is precisely that "minus signs cancel" flip written algebraically: (1)n=(1)n+1. Both forms are the same number; use the brace when a sketch or a physical sign matters, the (1)n+1 form when you are about to sum the series.

Where this shows up: it is the boundary term from tsin(nt)dt in the sawtooth bn coefficient. That is why the sawtooth series alternates in sign, +,,+,: the (1)n+1 is doing it.

Integration by parts: the formula, where it comes from, and the Fourier workhorse

Integration by parts is the product rule run backwards. It trades the integral you cannot do for one you can, and it is the tool behind every tsin(nt)dt and tcos(nt)dt in the Fourier unit.

The formula

udv =uv vdu

With limits, the uv term gets evaluated at them too:

abudv = [uv]ab abvdu

Where it comes from: the product rule, reversed

Differentiate a product of two functions:

ddt (uv) = udvdt + vdudt

Integrate both sides with respect to t. The left side is a derivative being integrated, so it collapses back to uv:

uv = udv + vdu

Move one integral to the other side and you have the formula. Nothing deeper than that: by parts IS the product rule, read right-to-left.

How to pick u and dv

  • 1u = the part that gets simpler when differentiated. Powers of t are the classic pick: t differentiates to 1 and vanishes from the leftover integral.
  • 2dv = the part you can integrate on sight: sin(nt), cos(nt), ekt all recycle forever under integration.
  • 3Fourier habit: always u=t (or t2), dv= the trig part. A t2 needs by parts twice; each pass drops the power by one and pulls out a factor of 1n.

The workhorse, in full: ∫ t sin(nt) dt

Choose u=t and dv=sin(nt)dt. Then du=dt, and integrating dv gives v=cos(nt)n. Feed everything into the formula:

tsin(nt)dt = tcos(nt)n (cos(nt)n)dt = tcos(nt)n + 1ncos(nt)dt

(The two minus signs on the leftover integral cancelled into a plus.) Finish with cos(nt)dt=sin(nt)n:

tsin(nt)dt = tcos(nt)n + sin(nt)n2

The companion result, same moves with dv=cos(nt)dt:

tcos(nt)dt = tsin(nt)n + cos(nt)n2

Where marks die: the minus sign in v=cos(nt)n and the double negative it creates one line later. Also: no +c is needed for v itself, any one antiderivative works, the constant is added once at the very end (and not at all in definite integrals).

Where do the cos and sin in x² + y² = r²(cos²θ + sin²θ) come from?

They come from the definition of polar coordinates. Polar describes a point not by "how far right, how far up" (x,y), but by "how far from the origin, at what angle" (r,θ). The cos and sin are just the conversion between the two languages.

Step 1: the conversion formulas (SOH-CAH from the triangle)

Drop a vertical from the point down to the x-axis: you get a right triangle with hypotenuse r and angle θ at the origin. The horizontal leg is x (adjacent), the vertical leg is y (opposite). Ordinary trigonometry:

cosθ=adjhyp=xr sinθ=opphyp=yr

Multiply each through by r and you get the two substitution formulas:

x=rcosθ y=rsinθ
x y θ (x, y) = (r cos θ, r sin θ) r x = r cos θ y = r sin θ
The right triangle behind polar coordinates: hypotenuse r, angle θ, legs x = r cos θ and y = r sin θ.

Step 2: substitute both into x² + y²

x2+y2 = (rcosθ)2 + (rsinθ)2 = r2cos2θ + r2sin2θ

(Squaring a product squares each factor: (rcosθ)2=r2cos2θ.)

Step 3: factor out r² and use the Pythagorean identity

Both terms share r2, so pull it out, and the bracket that remains is the most famous identity in trigonometry, equal to 1 for every angle:

r2 (cos2θ+sin2θ) = r2·1 = r2

Why cos2θ+sin2θ=1: it is Pythagoras on the same triangle. The legs are rcosθ and rsinθ, the hypotenuse is r, so legs² sum to hypotenuse², and dividing through by r2 leaves exactly that identity.

So the whole line in the notes is: substitute the polar definitions of x and y, square them, factor, and the trig disappears, leaving the beautifully simple integrand r2. That collapse is precisely why polar is the right tool whenever x2+y2 appears.

How did I get radius 5 from x² + y² ≤ 25?

Because 25 is 52, and for a circle centred at the origin the number on the right of x2+y2 is the radius squared. So you read the radius off by square-rooting it.

Where x2+y2=R2 comes from

A circle is every point at the same distance R from the centre. The distance of a point (x,y) from the origin is, by Pythagoras, x2+y2. Set that equal to R and square both sides:

x2+y2 =R x2+y2=R2
x y R x y (x, y)
A point (x, y) on the circle is the hypotenuse-distance R from the centre. Pythagoras on the two legs gives x² + y² = R².

So match it to 25

The region's boundary is x2+y2=25. Line that up with x2+y2=R2:

R2=25 R=25=5

(You take the positive root because a radius is a length.)

Why that instantly gives the polar limit

In polar, r2=x2+y2, so the filled disk x2+y225 is just:

r225 r5 0r5

General rule: on a circle centred at the origin, x2+y2=c is a circle of radius c. The bare number is always the radius SQUARED, so square-root it. (Here 25=5; if it had been 9 the radius would be 3.)

Why does the θ-integral just multiply by 2π?

Because once the inner integral is finished, 13R3 is a plain constant as far as θ is concerned: R is a fixed radius, and there is no θ left in it. And a constant slides straight out of the integral.

The mechanics

Pull the constant to the front:

02π 13R3 dθ = 13R3 02π 1dθ

and the leftover integral is just integrate 1 across the interval, which measures the interval's width:

02π 1dθ = [θ]02π = 2π0 = 2π

So the whole thing is the constant times 2π:

13R3·2π = 23πR3

The one-line picture

An integral is the area under a graph. Plot the constant height 13R3 against θ from 0 to 2π and you get a flat line, so the region under it is simply a rectangle. No calculus needed once you see that.

θ ⅓R³ 0 height × width ⅓R³ × 2π width = 2π
The flat line at height ⅓R³ from θ=0 to θ=2π. The area beneath is a rectangle: height × width = ⅓R³ × 2π.

Contrast: this shortcut works ONLY because θ dropped out of the integrand. If a θ had remained, say θdθ=θ22, integrating would reshape it and you could not just multiply. "Contains no θ" is the flag that the collapse to a single factor of 2π is allowed.

The u = R² − r² substitution, every step

First, what substitution even is: it is the chain rule run backwards. When an integral contains some inner expression AND (a multiple of) that inner expression's derivative, you rename the inner expression u, let du swallow the derivative part, and you are left with a clean, easy integral in u.

Step 0: the piece we are integrating

Only the inner (the r) integral needs work; θ comes later. It is:

I= r=0R rR2r2 dr

Step 1: why u = R² − r² is the right pick

Look at what sits inside the square root, R2r2, and differentiate it (remember R is a fixed constant, so R2 differentiates to 0):

ddr (R2r2) =2r

That derivative is 2r, and there is an r already multiplying the root out front. So the rdr in the integral is exactly the derivative part, up to the constant 2. That match is the whole reason this substitution works.

Step 2: build the substitution

Set u to the inner expression, differentiate, then rearrange to isolate the exact clump rdr that appears in the integral:

u=R2r2 du=2rdr rdr=12du

That last arrow is just dividing du=2rdr by 2 on both sides.

Step 3: rewrite the whole integral in u

Two swaps: the root R2r2 becomes u, and the clump rdr becomes 12du. The constant 12 then just slides out front:

rR2r2dr = u(12du) = 12u1/2du

(u is the same as u1/2, written that way so the power rule applies.)

Step 4: integrate u1/2 with the power rule

The power rule undu=un+1n+1 with n=12 gives n+1=32:

u1/2du = u3/23/2 = 23u3/2

Dividing by 32 is the same as multiplying by 23, which is where the 23 comes from.

Step 5: combine the constants and undo the substitution

12·23u3/2 = 13u3/2 = 13(R2r2)3/2

12·23=26=13, and we put u back as R2r2 so we can use the original r limits. That is the antiderivative the notes jumped straight to.

Step 6: put in the limits r = 0 and r = R

Evaluate 13(R2r2)3/2 at the top then the bottom, and subtract.

  • RAt r=R: R2R2=0, and 03/2=0, so this end is 0.
  • 0At r=0: R20=R2, and (R2)3/2=R2·3/2=R3, so this end is 13R3.

Definite integral is top minus bottom. Watch the double negative:

I= (0) (13R3) = 13R3

Subtracting a negative flips it to a plus, which is why the answer comes out positive.

Step 7: the outer integral, then double it

13R3 has no θ in it, so integrating over θ from 0 to 2π just multiplies it by 2π:

Vhalf= 02π 13R3dθ = 13R3·2π = 23πR3

That is one half (a hemisphere). Double it for the full sphere:

Vsphere= 2·23πR3 = 43πR3

The one habit that makes substitution click: scan the integrand for an inner function whose derivative (up to a constant) is also sitting there. Name it u, let du absorb that derivative, and what remains is always a plain power of u you can integrate on sight.

How did I know 3x − 2 is the top limit and y = x the bottom?

The strip is vertical, so y is the inner variable. Fix an x and slide up the strip: the lower limit is whichever boundary the strip sits on (the curve underneath), and the upper limit is whichever boundary it hits at the top (the curve above). So the whole question is: between x=1 and x=2, which line is higher, y=3x2 or y=x?

Fastest way: test one x

Both lines meet at the corner (1,1), so pick any x strictly inside the strip, say x=32, and read off both heights:

3x2 = 3·322 = 52 x=32

and 52>32, so 3x2 is the higher one. That makes it the top (upper limit) and y=x the bottom (lower limit).

Why it stays that way across the whole strip

You do not have to re-test every point, the slopes settle it:

  • 1Both boundary lines pass through the same corner (1,1).
  • 2y=3x2 has slope 3; y=x has slope 1. From a shared point the steeper line climbs faster, so for every x>1 it sits above the gentler one.

So 3x2 is on top for the entire strip 1x2, never crossing below until the two lines have already met at the apex.

x y y = 3x − 2 y = x top bottom x = 3⁄2 (1,1) (2,4) (3,3)
One vertical strip at x = 3/2. It rises from the green line y = x (bottom) to the blue line y = 3x − 2 (top). Any x in [1, 2] gives the same order, so blue is always the upper limit.

Hence the inner integral runs bottom to top:

y=x3x2 ()dy

The rule to carry away: for a vertical strip the upper limit is whichever curve is on top and the lower limit is whichever is underneath. When two curves swap or you are unsure, plug one x-value into both, the larger y is the ceiling.

Why is this split into two integrals, and where do all the limits come from?

This uses vertical strips: y is the inner variable (each strip runs bottom to top) and x is the outer variable (the strips sweep left to right). Every strip starts on the same bottom edge, but the top edge changes partway across, and that is the whole reason for the two integrals added together.

V= x=12 y=x3x2 (3y3x)dydx + x=23 y=xx+6 (3y3x)dydx

Why the + (why it splits at x = 2)

Walking left to right, the bottom of every strip is the same line, y=x (the green edge). The top is not:

  • LFor 1x2 the top edge is the blue line y=3x2.
  • RFor 2x3 the top edge is the orange line y=x+6.

A single integral needs one formula for its upper limit, but the top switches at the apex (2,4). So you cut the region at x=2, integrate each half with its own top line, and add. That is the "done twice" you spotted.

x y x = 2 (split) y = 3x − 2 y = x y = −x + 6 (1,1) (2,4) (3,3)
Left region (blue-tinted): strips top out on y = 3x − 2. Right region (orange-tinted): strips top out on y = −x + 6. Both sit on y = x. The dashed x = 2 is the cut through the apex.

Where each limit comes from

  • 1Inner lower y=x — the bottom of every strip, the green edge joining (1,1) and (3,3). Same in both integrals.
  • 2Inner upper 3x2 (left integral) — the blue top edge, valid only while x2.
  • 3Inner upper x+6 (right integral) — the orange top edge, valid once x2.
  • 4Outer x: 12 then 23 — the x-span of each half: left vertex x=1, apex x=2 (the cut), right vertex x=3.

Seam check: at x=2 the blue top gives 3(2)2=4 and the orange top gives 2+6=4, both the apex, so the two halves meet cleanly. At x=1 and x=3 the top equals the bottom, so the strips shrink to the side vertices.

Where do the three edge equations come from?

Each edge of the triangle is the straight line through two of its corners, and two points fix a line completely. The recipe is always the same two steps: find the slope, then feed it and one point into point-slope form.

m= y2y1x2x1 yy1=m(xx1)
x y y = 3x − 2 y = x y = −x + 6 (1, 1) (2, 4) (3, 3)
Each side is coloured to match its equation. Every line is just "the straight line through those two corners".

Blue edge: (1, 1) to (2, 4)

m= 4121 =3 y1=3(x1) y=3x2

Green edge: (1, 1) to (3, 3)

m= 3131 =1 y1=1(x1) y=x

Orange edge: (2, 4) to (3, 3)

m= 3432 =1 y4=1(x2) y=x+6

Pairing check: the three corners give exactly three pairs, and each pair is one edge, (1,1)–(2,4), (1,1)–(3,3) and (2,4)–(3,3). The dashed line x=2 in the moodle figure is not an edge; it is the vertical through the apex (2,4), marking where the top boundary switches from the blue line to the orange line, which is why that integral has to be split there.

Where does each limit in the double integral come from?

Two integral signs means four numbers to justify. Every one is read straight off the triangle R, whose edges are x0, y0 and x+y1. We integrate in horizontal strips: x is the inner variable (moving along a strip), y is the outer variable (choosing which strip).

y=01 x=01y (x2+y2) dxdy

Inner integral — the two x-limits

Fix a height y and slide across the strip. The limits are where the strip enters and leaves the region:

  • 1x=0  (lower) — the strip enters on the left edge, the y-axis. That edge is the boundary x0.
  • 2x=1y  (upper) — the strip leaves on the slanted edge x+y=1. Solve that for x: x=1y. It carries a y only because the edge is sloped.

Outer integral — the two y-limits

Now sweep the strip through every height the triangle occupies. These bounds must be constants:

  • 3y=0  (lower) — the lowest strip lies on the bottom edge, the x-axis, which is the boundary y0.
  • 4y=1  (upper) — the highest strip shrinks to the apex (0,1), where the left edge x=0 meets the slant x+y=1.
the question fixes the region R : x ≥ 0 y ≥ 0 x + y ≤ 1 its top end, at x = 0 (x² + y²) dx dy 1 y = 0 1 − y x = 0
Each limit is coloured to match the piece of the question it is read from. x = 0 comes from x ≥ 0, x = 1 − y from x + y ≤ 1, y = 0 from y ≥ 0. The outer top limit y = 1 (dashed) is not written in the question: it is the top end of the line x + y = 1, where x = 0.

The one rule that fixes the order: inner limits describe the moving strip and may contain the outer variable (that is the 1y), while outer limits describe the whole region and are always plain constants (0 and 1).

How do you get the limits for the HW8a triangle double integral?

Every limit comes from reading the three edges of the triangle and then following one horizontal strip. The region R is x0, y0, x+y1, so its edges are:

  • 1x=0  — the y-axis (left edge)
  • 2y=0  — the x-axis (bottom edge)
  • 3x+y=1, rearranged to x=1y  — the slanted hypotenuse (right edge)

Inner limits: follow one horizontal strip

Horizontal strips means x is the inner variable. Fix a height y and move along the strip left to right, asking where it enters and exits the region:

It enters on the left at x=0 (the y-axis), and exits on the right at the hypotenuse. Solving x+y=1 for x gives x=1y. So the inner limits are

x:01y

The upper one depends on y precisely because the right edge is slanted, not vertical: as the strip rises, its right end slides left along the line.

x y x = 1 − y x: 0 → 1−y R 1 1 y
One horizontal strip at height y. It starts on the y-axis (x = 0) and ends on the hypotenuse (x = 1 − y). The strip then sweeps upward through every height from y = 0 to y = 1.

Outer limits: sweep the strip over the region

The outer variable y runs over every height the region reaches, and these must be constants. The lowest strip sits on the base at y=0; the highest is where the triangle pinches to its apex, where x=0 meets x+y=1, i.e. y=1. So y:01, and the whole integral is

V= y=01 x=01y (x2+y2) dxdy

The two rules to carry away

  • 1Inner limits describe the strip and may depend on the outer variable (here the right limit is 1y). Read them off where the strip enters and exits.
  • 2Outer limits describe the whole region and must be constants (here y from 0 to 1). Read them off the lowest and highest the outer variable reaches.

Sanity check on the slant: at y=0 the strip runs x:01 (the full base); at y=1 it runs x:00 (zero length, the apex). That shrinking is exactly what x=1y encodes. Flip to vertical strips and the same logic gives y:01x inner, x:01 outer.

Where does |û| = √(¼ + ¾) = 1 come from?

It’s a quick check that the direction vector really has length 1, and the two fractions are just its components squared, nothing more.

The line just above it sets the unit direction from the angle a=π3:

u^= (cosπ3,sinπ3) = (12,32)

The length of any 2D vector (a,b) is a2+b2, so here:

|u^|= (12)2 + (32)2

and that is exactly where the two numbers come from:

(12)2=14  — the first component squared, since cosπ3=12.

(32)2=34  — the second component squared: 3 squared is 3, over 22=4.

14+34 =1=1

Why the check is there at all

The directional-derivative formula f·u^ only gives the true slope if u^ has length exactly 1. This line verifies that before it’s used. And it will always come out to 1 for a direction written (cosa,sina), because 14+34 is really cos2a+sin2a, and the Pythagorean identity guarantees:

cos2a+ sin2a=1

So it is partly a genuine check, and partly a reassurance that the (cosa,sina) trick automatically produces a unit vector.

What does “direction of steepest ascent” actually mean?

Picture the function’s graph as a hilly landscape: at every point (x,y) the value f(x,y) is the height of the ground. Standing at one spot, you can step off in any compass direction, and depending which way you face the ground rises faster, rises slower, stays level, or drops.

The direction of steepest ascent is the compass direction you’d face to climb uphill as fast as possible. Turn slightly away and the ground still rises, but less steeply; face exactly opposite and you get steepest descent.

It is exactly the gradient

That best direction is given directly by the gradient, the vector of the partial derivatives you were computing:

f= ( fx , fy )

The direction this vector points (in the flat xy-plane) is the direction of steepest ascent. Its length tells you how steep that steepest climb is, the slope in the best direction:

|f|= (fx)2 + (fy)2

Why the partials assemble into the right direction

fx is how fast height changes if you walk purely east, fy if you walk purely north. Any real direction is a blend of the two, and the slope you feel along a unit direction at angle α is the directional derivative, the dot product of the gradient with that direction:

mα= f·l^= fxcosα + fysinα

A dot product is largest when the two vectors are parallel, so the slope is biggest exactly when your walking direction lines up with f. That is the whole reason the gradient is the steepest direction.

Two facts to carry into the exam

  • 1The gradient is always perpendicular to the level curve (the contour of constant height) through your point. Along a contour the height doesn’t change, and steepest-uphill is exactly at right angles to “no change”.
  • 2Steepest descent is just f, the same arrow flipped. That’s the idea behind gradient-descent: to reach a minimum, keep stepping in the f direction.
peak ∇f −∇f level curve (zero slope) P
A contour map of a hill: each ring is a line of constant height, the peak at the centre. At point P the gradient ∇f points straight uphill, perpendicular to the contour through P; its length is the slope there. The dashed contour direction is where the slope is zero, and −∇f is the steepest way down.

A quick concrete case

Take a bowl f(x,y)=x2+y2. Its gradient is

f= (2x,2y)

At any point this arrow points straight away from the origin, which is indeed the steepest way up the side of the bowl, and f points back down toward the bottom.