I was trying to derive the formula for the surface area of the curved part of a cone, but ran into a problem. Let $f(x)=kx$ be any line with any angle passing through the origin, $h$ be the height (non-slanted) of the cone, $l$ be the slant height, and $r$ be the base radius.
Then, the surface area of the cone should be the sum of all of the circumferences of the values of $f(x)$ for $0\leq x\leq h$
$$2\pi \int_{0}^{h} f(x)dx = 2\pi \int_{0}^{h} kx dx = \pi kh^2$$
From the graph, k is just the rise over the run: $\frac{r}{h}$
$$\pi kh^2=\pi rh$$ However, looking online the correct formula is $\pi rl$, and I am confused where I went wrong.