Method: Write px+q = A * d/dx(ax^2+bx+c) + B = A(2ax+b) + B. Solve for A and B: 2aA = p, Ab + B = q. So A = p/(2a), B = q - bp/(2a).
Split the integral: integral (px+q)/sqrt(ax^2+bx+c) dx = A * integral (2ax+b)/sqrt(ax^2+bx+c) dx + B * integral dx/sqrt(ax^2+bx+c)
First integral: integral (2ax+b)/sqrt(ax^2+bx+c) dx = 2*sqrt(ax^2+bx+c) + C (since the numerator is the derivative of the expression under the root)
Second integral: Complete the square and use standard forms:
- integral dx/sqrt(X^2+k^2) = ln|X+sqrt(X^2+k^2)| + C
- integral dx/sqrt(k^2-X^2) = arcsin(X/k) + C
- integral dx/sqrt(X^2-k^2) = ln|X+sqrt(X^2-k^2)| + C