I have been presented with the following differential equation which I'm asked to solve, where $y=0$ when $x=\pi$. $$(y+1)\sin x\frac{dy}{dx} = (y^2+1)\tan^2x$$

I notice that $(y^2+1)$ may be expressed as $(y+1)(y-1)$ in order to be able to cut with the $(y+1$ on the opposing side which boils down to: $$\sin x\frac{dy}{dx} = (y-1)\tan^2x$$

I then seperate the variables accordingly to get one side in terms of $dy$ and the other side in terms of $dx$ $$\frac{1}{(y-1)}dy = \frac{1}{\sin x}\tan^2xdx$$

and my final presentation of the above differential prior to integrating ended up being $$\int \frac{1}{(y-1)} dy = \int \frac{\sin x}{\cos^2 x}dx$$

Not to bore you through my entire integration method I will give my results for now. If they are incorrect or the steps I took are requested I'll gladly provide them.

$$LHS = \ln \left | y-1 \right | + C$$

$$RHS = \frac{\sec x}{2} + C$$

$$\ln \left | y-1 \right | = \frac{\sec x}{2} + C$$

Now solving for the above result does not seem to make all too much sense to me as it seems to be undefined (though looks odd if the question requests an undefined set of values for x & y)

Right Hand Side (RHS)

The following are my steps when simplifying the RHS of the previous integral.

$\int \frac{\sin x}{\cos^2x} = \int \frac{1}{ \cos x } \tan xdx = \int \sec x \ tan x dx$. From here I applied Integration by parts.

$$u = \sec x$$ $$\frac{dv}{dx} = \tan x$$ $$\frac{du}{dx} = \sec x \tan x$$ $$v = \ln \left | \sec x \right |$$

$\sec x \ln | \sec x | - \int \tan x \sec x \ln | \sec x |$

$\ln |\sec x|^{\sec x} - \int \tan x \ln |\sec x|^{\sec x}$

$\sec x - \int \tan x \sec x = \int \tan x \sec x dx$

$\therefore \sec x = 2\int \tan x \sec x dx$

$\frac{\sec x }{2} = \int \tan x \sec x dx$

  • $\begingroup$ MathJax hint: $\sin, \cos, \tan, \sec$ etc. are builtin function names, use \sin, \cos, \tan, \sec to improve readability $\endgroup$ – AlexR May 4 '15 at 10:49
  • $\begingroup$ When integrating the RHS, you get csc(x)+C. $\endgroup$ – wythagoras May 4 '15 at 10:49
  • $\begingroup$ @AlexR Thanks haha $\endgroup$ – Juxhin May 4 '15 at 10:50
  • 1
    $\begingroup$ @wythagoras No, it's $\sec x = \frac1{\cos x}$. $\endgroup$ – AlexR May 4 '15 at 10:50
  • 1
    $\begingroup$ @AlexR - I double-checked my answer with an integral calculator for the RHS and it did match $\endgroup$ – Juxhin May 4 '15 at 10:51

Is there a typing mistake in the wording of the question ? You write : $$(y+1)\sin x\frac{dy}{dx} = (y^2+1)\tan^2x$$ But after, you write $(y^2+1)=(y+1)(y-1)$ which is false. May be, the equation is : $$(y+1)\sin x\frac{dy}{dx} = (y^2-1)\tan^2x$$ Anyway, in both cases, the ODE is separable.


If it is $(y+1)\sin x\frac{dy}{dx} = (y^2-1)\tan^2x$ then : $$\frac{1}{y-1}dy = \frac{\sin(x)}{\cos^2(x)} dx$$ I let you continue the integration which is easy.


If it is $(y+1)\sin x\frac{dy}{dx} = (y^2+1)\tan^2x$ then : $$\frac{y+1}{y^2+1}dy = \frac{\sin(x)}{\cos^2(x)} dx$$ Hit : An antiderivative of $\frac{y+1}{y^2+1}$ is $\frac{1}{2}\ln(y^2+1)+\tan^{-1}(y)$ So, I let you continue. You will be able to express $x$ as a function of $y$, but not the inverse function.


The original ODE $(y+1)\sin x\frac{dy}{dx} = (y^2+1)\tan^2x$ and the "supposed" one $(y+1)\sin x\frac{dy}{dx} = (y^2+1)\tan^2x$ , both in addition have a lot of trivial solutions : $$\sin(x)=0$$ $$x(y)=n\pi$$


If there was a typo in the ODE, here is the solution, if not, see below for a solution to the ODE as it is written:
Formally inverting what you have there (after fixing the RHS) we get $$|y-1| = \exp(\sec x + C) = \tilde C \exp(\sec x)$$ And thus $$y = 1 \pm \tilde C\exp(\sec x) = 1 + \bar C \exp(\sec x)$$ Now we plug in the IVP $y = 0, x=\pi$ to see that $$0 = 1 + \bar C \exp(\sec \pi) = 1 + \bar C e^{-1} \Rightarrow \bar C = -e$$ This yields the solution $$y(x) = 1 - e \exp(\sec x) = 1 - \exp(\sec x + 1)$$

However this does not solve the original IVP because $y^2 + 1 = (y+i)(y-i) \ne (y+1)(y-1)$ as noted by @EmilioNovati. Fixing this results in a different LHS but the same RHS. Thus we obtain $$\int \frac{y+1}{y^2 + 1} \ \mathrm dy = \sec x + C$$ The integral can be solved seperating $$\int \frac y{y^2+1} \ \mathrm dy = \frac12 \ln (y^2 + 1) + C$$ and $$\int \frac1{y^2+1} \ \mathrm dy = \arctan y + C$$

Thus we need to solve $$\frac12\ln(y^2 + 1) + \arctan y = \sec x + C$$ For this we should use the complex logarithm so that $\arctan y = \frac1{2i} \ln(\frac{y-i}{y+i}) + C$ wich allows us to collapse the LHS to one complex logarithm.

  • $\begingroup$ I'll be honest, I'm unfimiliar with this notation. I've appended the steps I took to work out the RHS. $\endgroup$ – Juxhin May 4 '15 at 11:11
  • $\begingroup$ @Juxhin Wich notation? I just changed the constant $C$ a couple of times to reduce the complexity of the equation. $C = \exp \tilde C$ and $\bar C = \pm \tilde C$ depending on whether we add or subtract in the absolute value. $\endgroup$ – AlexR May 4 '15 at 11:14
  • $\begingroup$ OH okay, was unfamiliar with what you meant by exp and the various forms of C $\endgroup$ – Juxhin May 4 '15 at 11:16
  • $\begingroup$ @Juxhin Well, $\exp$ is the exponential function, $\exp x = e^x$. $\endgroup$ – AlexR May 4 '15 at 11:16
  • $\begingroup$ Alright great, will examine this properly and see if I can get to the same conclusion. Thanks Alex $\endgroup$ – Juxhin May 4 '15 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.