Why/How does this function become 1 when integrated?

Question asks to show that if $$f(x)= \begin{cases} \frac14xe^\frac{-x}{2} & x>0\\[8pt] 0 & \text{elsewhere}, \end{cases}$$ then $$\int_0^\infty f(x)\,dx=1.$$

I get

$$\int f(x) = \frac14 \left [-4e^\frac{-x}{2}(-\frac{x}{2} - 1) + C \right]$$ And I don't get how this ends up being equal to 1.

-
Check out what I did to reformat the post. – Cameron Buie Nov 5 '12 at 19:02
Thank you, @CameronBuie. That was super helpful! – Siyanda Nov 5 '12 at 19:06
Missing minus sign. – copper.hat Nov 5 '12 at 19:13

Your integration is correct except for a sign error. First note taking the sign error into account, your answer can be simplified into $$-\exp(-x/2) \left(\dfrac{x}2+1 \right) + C$$ All you need to do now is to plug in the limits. $$\left. \left(-\exp(-x/2) \left(\dfrac{x}2+1 \right) \right)\right \vert_{0}^{\infty}$$ Plugging in the upper limit, we get that $$\text{upper limit} = \lim_{x \to \infty} \left(-\exp(-x/2) \left(\dfrac{x}2+1 \right) \right) = 0\,\,\,\,\, (\text{Why}?)$$ Plugging in the lower limit $$\text{lower limit} = \left. \left(-\exp(-x/2) \left(\dfrac{x}2+1 \right) \right)\right \vert_{x=0} = -\exp(-0/2) \left(\dfrac{0}2+1 \right) = -1 \times 1 = -1$$ Hence, the value of the definite integral is $0-(-1) = 1$.

-

When computing indefinite integrals, you instead compute the limit $\lim_{b \to \infty} \int_a^b f(x)\ dx$. You can then use your improper form to compute the limit.

Namely, you should see that

$$\lim_{b\to\infty} -4e^{-x^2/2}\left(-\frac{x}{2}-1\right) = 0$$

-
Your limit calculation is incorrect. That $0$ shouldn't be there. – Cameron Buie Nov 5 '12 at 19:08
I originally made an error where I neglected to distribute properly; it has been edited, and what is there now should be correct. Wolfram Alpha agrees: wolframalpha.com/input/?i=lim%28-4*exp%28-x^2%2F2%29*%28-x%2F2-1%29%2‌​Cx+to+infinity%29 – Emily Nov 5 '12 at 19:10

Since we're looking at a definite integral, there's no need for the $C$. Since we're dealing with improper integrals, we have that $$\int_0^\infty f(x)\,dx=\lim_{a\to 0^+}\lim_{b\to\infty}\int_a^b f(x)\,dx.$$ Evaluate the proper integral first, then take the limits. The $a$ limit is easy. The $b$ limit may require a bit of finagling, such as applying L'Hopital's Rule.

As a side note, it doesn't actually matter for this calculation that $f(x)=0$ for $x\leq 0$. However, if we were trying to show that $\int_{-\infty}^\infty f(x)\,dx =1$, then that would come into play.

-