# Simple integral

## Homework Statement

why do i need the information that y>0?

## Homework Equations

$$\frac{dy}{dx}=f(x)~\rightarrow~dy=f(x)dx~\rightarrow~y=\int f(x)dx$$

## The Attempt at a Solution

$$\frac{dy}{dx}=\frac{x}{y}~\rightarrow~\int y~dy=\int x~dx~\rightarrow~y^2=x^2~\rightarrow~y=x$$
I square root y2 and if y<0 it works also

## Answers and Replies

haruspex
Science Advisor
Homework Helper
Gold Member
2020 Award
A couple of inaccuracies.
You should allow a constant of integration since you are not given any initial condition.
When taking the square root you must allow for opposite signs.
If your answer allows y>0 then your answer is wrong. You need to write it such that y is > 0. (Merely adding the text "y>0" would do, but maybe there's something better.)

LCKurtz
Science Advisor
Homework Helper
Gold Member
To add to haruspex's remarks, when you add the constant of integration and show your steps, I think it will be apparent where you use the ##y>0## information.

With y>0:
$$\frac{dy}{dx}=\frac{x}{y}~\rightarrow~y^2=x^2+C$$
$$\left\{ \begin{array}{lr} \mbox{for}~x>0 & y=x \\ \mbox{for}~x<0 & y=-x \end{array}\right.$$

LCKurtz
Science Advisor
Homework Helper
Gold Member
With y>0:
$$\frac{dy}{dx}=\frac{x}{y}~\rightarrow~y^2=x^2+C$$
$$\left\{ \begin{array}{lr} \mbox{for}~x>0 & y=x \\ \mbox{for}~x<0 & y=-x \end{array}\right.$$
Technically, without skipping steps you have$$\frac {y^2} 2 = \frac {x^2} 2 + C$$And you are ignoring the ##C## in your answer.

Yes, right, i omitted the division by 2 for shortening. after it comes ##~y^2=x^2+C## and the rest, right?
The condition y>0 must have been imposed since without it ##~y=\pm x## and this isn't a function since every x has 2 y's. am i right?

LCKurtz
Science Advisor
Homework Helper
Gold Member
I figured you were using a shortcut, but still you have to solve ##y^2 = x^2 + C## for ##y##.

$$y^2=x^2+C~\rightarrow~y=\pm \sqrt{x^2+C}$$
This isn't a function since each x has two y's, so, with the help of y>0:
$$y=+\sqrt{x^2+C}~\rightarrow~y=\pm (x+C)$$

Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
$$y^2=x^2+C~\rightarrow~y=\pm \sqrt{x^2+C}$$
This isn't a function since each x has two y's, so, with the help of y>0:
$$y=+\sqrt{x^2+C}~\rightarrow~y=\pm (x+C)$$
View attachment 112302

If ##C > 0## the functions ##y = \sqrt{x^2+C}## and ##y = + (x+C)## or ##y = -(x+C)## are different; their graphs do not even look the same. One of them is differentiable everywhere, while the other two are not.

haruspex
Science Advisor
Homework Helper
Gold Member
2020 Award
$$y=+\sqrt{x^2+C}~\rightarrow~y=\pm (x+C)$$
Think that through again.

$$y=+\sqrt{x^2+C}$$
This is the final answer, i can't simplify further

haruspex
Science Advisor
Homework Helper
Gold Member
2020 Award
$$y=+\sqrt{x^2+C}$$
View attachment 112339 This is the final answer, i can't simplify further
Looks good. A possible quibble is that you are given y>0, not y≥0.

Thank you LCKurtz, Ray Vickson and Haruspex