If P is the variable that you are integrating. For example, $\int \sin(x^2) d(x^2)$ can be computed the way it seems you want to compute it. That is, $\int \sin(x^2) d(x^2) = - \cos(x^2)$. However, $\int \sin(x^2) dx \neq - \cos(x^2)$. The question you are asking has a lot to do with the integration method known as "u-substitution." Do you know what that is?