5
$\begingroup$

Find $\frac{dy}{dx}$ if $x\sqrt{1+y}+y\sqrt{1+x}=0$ for $-1\leq x\leq 1$

$$\frac{dy}{dx}=\frac{-1}{(1+x)^2}\text{ if }x\neq y$$

If it was like $y=\sqrt{1+x}$ i think i know how to do it

D[Sqrt[1+x],x]

but how do i differentiate the functions like the one above ?

$\endgroup$

4 Answers 4

6
$\begingroup$

Perhaps not the most optimal method, but you could:

  1. Take the total derivative with respect to x
  2. Solve for y'[x]
  3. Solve the given equation for y
  4. Substitute (3) in (2)
  5. Simplify, assuming bounds for x given

    Simplify[
           Solve[Dt[x \[Sqrt](1 + y) + y \[Sqrt](1 + x), x] == 0, 
                 Dt[y, x]] /. 
               y -> Solve[x \[Sqrt](1 + y) + y \[Sqrt](1 + x) == 0, y][[1, 1, 2]],
            Assumptions -> {x >= -1, x <= 1}][[1, 1, 2]]
    

output:

-(1/(1 + x)^2)

Edit: @Nasser gives the "more optimal" method I suggested in the beginning. I do too much solving and differentiating.

Instead of Differentiating, Solving, Solving, Substituting, and Simplifying (5 steps); why not just Substitute, Solve, Differentiate, and Simplify (4 steps) (Nasser's improvement)? Alternatively (my slight improvement), just Solve, Differentiate, and Simplify (3 steps):

Dt[Solve[x √(1 + y) + y √(1 + x) == 0, y], 
  x] // Simplify

Out:

{{Dt[y, x] -> -(1/(1 + x)^2)}}

Easier to look at version: Traditional Form output

It turns out that including the bounds on x are redundant! However, if you wish to include them (again, unnecessary):

Simplify[Dt[Solve[Sqrt[x + 1] y + x Sqrt[y + 1] == 0, y], {x}], 
 Assumptions -> {x >= -1 && x <= 1}]
$\endgroup$
3
$\begingroup$

Why not just

ClearAll[y,x]
expr = x Sqrt[1+y]+y Sqrt[1+x]==0;
expr = expr/.y->y[x];
D[Solve[expr,y[x]],x]//Simplify

Mathematica graphics

I am not sure if this is what the above answer is doing, but I get different output, from each so I thought to post this. If it turns out to be just a extra simplification step is needed, will delete my answer.

$\endgroup$
3
$\begingroup$

Just substitude y->y[x]

First atttempt:

Solve[0 == D[x Sqrt[1 + y[x]] + y[x] Sqrt[1 + x], x], y'[x]][[1]]
(*{Derivative[1][y][x] -> (Sqrt[1 + y[x]] (y[x] + 2 Sqrt[1 + x] Sqrt[1 + y[x]]))/(Sqrt[1 + x] (-x - 2 Sqrt[1 + x] Sqrt[1 + y[x]]))} *)

Everything is ok but knowledge about y is not included.

Final answer

eq= x \[Sqrt](1 + y[x]) + y[x] \[Sqrt](1 + x);
sol=Solve[{eq==0,D[eq,x]==0},{y[x],y'[x]}];
Simplify[sol,-1<=x<=1][[1]];
(* {y[x] -> -(x/(1 + x)), Derivative[1][y][x] -> -(1/(1 + x)^2)} *)
$\endgroup$
4
  • 1
    $\begingroup$ How does that answer the OP's question? $\endgroup$
    – Max Coplan
    Commented Apr 18, 2018 at 20:45
  • $\begingroup$ @MaxCoplan Why not, the OP has not said that the answer should be in terms of x. $\endgroup$
    – yarchik
    Commented Apr 18, 2018 at 21:11
  • $\begingroup$ thnx. but i am trying to get the same simplified answer as i have obtained whn solved myself. $\endgroup$ Commented Apr 18, 2018 at 22:09
  • $\begingroup$ @yarchik That's better now. OP did ask for the answer to be y'=-1/(x+1)^2, which is a function of x. UlrichNeumann now has it in terms of x $\endgroup$
    – Max Coplan
    Commented Apr 19, 2018 at 13:19
1
$\begingroup$

The function and its implicit derivative both vanish, so that gives a system of two equations in the two variables {y[x],y'[x]} to solve in terms of x.

expr = x *Sqrt[1 + y] + y*Sqrt[1 + x];
eyx = expr /. y -> y[x];
Simplify[y'[x] /. First[Solve[{D[eyx, x], eyx} == 0, {y[x], y'[x]}]]]

(* Out[43]= (
4 x + 3 x^2 - 4 Sqrt[1/(1 + x)] (1 + x)^(5/2))/((1 + x)^2 (2 + x)^2) *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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