To learn dependency injection in a current side-project, I am writing my own dependency injection container. 

But this has lead me to wonder, at what point is it worthwhile to use a third party product vs "roll my own"? What would be the kind of questions you would ask to figure this out? 


Question: Evaluating an integrals by appropriate substitution
Answer: When you are facing a radical which has a linear sum in it, it works well to use that as the basis of the substitution.  Here, you would take $ \ u = x + 1 \ $ , which will give you $ \ du = dx \ $ .  To deal with the numerator, you need to solve your substitution equation for $ \ x \ $ , giving $ \ x = u - 1 \ $ .  The integral becomes

$$ \int \  \frac{1+ x^2}{\sqrt{1 + x }} \ dx \ \rightarrow \ \int \frac{1 + (u - 1)^2}{\sqrt{u}} \ du  \ . $$ 

You would then multiply out the polynomial in the numerator.

The point in doing this is that you now have a polynomial divided simply by the square root of the variable, which will leave you with a set of terms in the integrand which are all just fractional powers of $ \  u \ $ , something which is much easier to integrate.