I've always seen variance as E[X^2] - E[X]^2 or the integral of x^2 * f(x)dx Is there a reason we use the formula above instead?

They are equivalent forms. The formula in the slides captures the actual intent of the variance better, I think.

These are indeed the same and this can be derived using linearity of expectation.

I've always seen variance as E[X^2] - E[X]^2 or the integral of x^2 * f(x)dx Is there a reason we use the formula above instead?

They are equivalent forms. The formula in the slides captures the actual intent of the variance better, I think.

These are indeed the same and this can be derived using linearity of expectation.