# Homework Help: Simple integral

1. Jan 27, 2017

### Karol

1. The problem statement, all variables and given/known data
why do i need the information that y>0?

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

3. 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

2. Jan 27, 2017

### haruspex

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.)

3. Jan 27, 2017

### LCKurtz

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.

4. Jan 28, 2017

### Karol

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.$$

5. Jan 28, 2017

### LCKurtz

Technically, without skipping steps you have$$\frac {y^2} 2 = \frac {x^2} 2 + C$$And you are ignoring the $C$ in your answer.

6. Jan 28, 2017

### Karol

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?

7. Jan 28, 2017

### LCKurtz

I figured you were using a shortcut, but still you have to solve $y^2 = x^2 + C$ for $y$.

8. Jan 30, 2017

### Karol

$$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)$$

9. Jan 30, 2017

### Ray Vickson

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.

10. Jan 30, 2017

### haruspex

Think that through again.

11. Jan 31, 2017

### Karol

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

12. Jan 31, 2017

### haruspex

Looks good. A possible quibble is that you are given y>0, not y≥0.

13. Jan 31, 2017

### Karol

Thank you LCKurtz, Ray Vickson and Haruspex