I am trying to maximize a function. When I took the first derivative, I found an expression very similar to one in original function. My question is that can I use the expression in the original function to simplify it and then again take derivative to find the optimum? I am not sure if it is mathematically correct. Thanks!
Following is the function and its derivative (when $Q<\frac{au}{2}$): $\pi_{1}=\int_{0}^{t^{*}}(\frac{a-\frac{Q}{u-vt}}{b})Qdt+\int_{t^{*}}^{T}\frac{a}{2b}(\frac{a}{2})(u-vt)dt-cQT$ So I took derivative with respect to Q as follow ($t^{*}$ is a function of Q with $u-vt^{*}=\frac{2Q}{a}$ and $\frac{\partial t^{*}}{\partial Q}=-\frac{2}{av}$): $ \frac{\partial \pi_{1}}{\partial Q}=\frac{\partial t^{*}}{\partial Q}(\frac{a-\frac{Q}{u-vt^{*}}}{b})Q+\int_{0}^{t^{*}}(\frac{a-\frac{2Q}{u-vt}}{b})dt-\frac{\partial t^{*}}{\partial Q}(\frac{a^2}{4b})(u-vt^{*})-cT$ $ \int_{0}^{t^{*}}(\frac{a-\frac{2Q}{u-vt}}{b})dt-cT=0 $ Then I used this expression that holds for optimal Q in the original function to simplify and got the following and again I took derivative. $\pi_{1}=\int_{0}^{t^{*}}\frac{Q^2}{b(u-vt)}dt+\int_{t^{*}}^{T}(\frac{a^2}{4b})(u-vt)dt$ $\frac{\partial \pi_{1}}{\partial Q}=\frac{\partial t^{*}}{\partial Q}\frac{Q^2}{b(u-vt^{*})}+\int_{0}^{t^{*}}\frac{2Q}{b(u-vt)}dt-\frac{\partial t^{*}}{\partial Q}(\frac{a^2}{4b})(u-vt^{*})=0$