# IVP Separable Equation where given answer not correct?

So I'm working on the following problem:

$$\frac{dy}{dx} = \frac{1+y^2}{1+x^2}, y=1, x=0$$

To me this appears as a separable first order differential equation, so I separate it into g(x) and h(y) as follows: $$\frac{dy}{dx} = \frac{1+y^2}{1+x^2}=\frac{1+y^2}{1}\frac{1}{1+x^2}$$ and this allows us to use the general solution of: $$\int\frac{dy}{h(y)} = \int g(x)dx + c$$ which in my example results in: $$\int\frac{dy}{1+y^2} = \int \frac{1}{1+x^2}dx + c$$ Which straight away we can apply the basic integral for arctan: $$arctan(y) = arctan(x) + c$$ At this point I multiplied both sides by tan to get y = f(x). From there working out c is just a matter of substituting our original values for x and y, I believe. I'll go no further at this point as I've done much of this on paper, but no matter what I try, I cannot arrive at the solution given in the notes.

The answer given in the notes is: $$y=\frac{1+x}{1-x}$$ At this point I also tried plugging the equation into some online calculators, and they arrived at a similar solution, this being wolframs answer: $$y(x) = tan(arctan(x) + π/4)$$

I'd be very thankful if someone could poke me in the right direction on this one, are the two answers somehow equivalent, or have a made a foolish error? Regardless, thanks for your help.

$$\tan(a+b) = \frac{\tan a + \tan b}{1-\tan a\cdot\tan b}.$$

• I'm sorry, but I don't understand how I can apply this to my result. – William Slater Oct 6 '19 at 15:19
• Oh wait, maybe I do, one moment. – William Slater Oct 6 '19 at 15:21
• You are suggesting that $tan(arctan(y)) = \frac{tan(arctan(x) + tan(c))}{1-tan(arctan(x)) + tan(c)}$? – William Slater Oct 6 '19 at 15:26
• No. You have $\arctan(y) = \arctan(x)+\arctan(1)$. Now, apply $\tan$ on both sides and use the formula for the right-hand side. – amsmath Oct 6 '19 at 15:29
• Thanks. I think that is what I have put but not simplified or substituted 1 for c. But I understand. Thank you again. – William Slater Oct 6 '19 at 15:32

Hint. When you multiplied both sides by $$\tan{},$$ what happened to the constant?

• This resulted in $y=tan(arctan(x)+c)$, which I cannot further simplify, (save to $x+tan(c)$ I believe. – William Slater Oct 6 '19 at 15:17
• @WilliamSlater No, it doesn't simplify to that. I believe you now know what it simplifies to since someone above has shown you how to resolve the tangent of a sum. – Allawonder Oct 6 '19 at 16:32
• How do you multiply with a function (not with a function value?) You can apply or compose functions, perhaps also concatenate or (en-)chain. – Lutz Lehmann Oct 6 '19 at 16:45
• @LutzL Use your favourite language. I went with OP's language because it's also right -- even though they might not have thought of it they way I did. – Allawonder Oct 6 '19 at 21:35