-1
$\begingroup$

I recently asked a question on how to integrate a trigonometric expression in $x$ with respect to $y$.

(Link:How to compute the integral $\int \cos x dy$?)

So, $$\int \cos(x) \, dy = y \cos(x) + C.$$

But if I differentiate the right hand expression with respect to $y$, I get

$\cos(x) - [y \sin(x) dx/dy]$ .

Am I doing something wrong ?

An elementary solution would be gratefully accepted.

  • 11
    You only get $\int \cos (x)\,dy = y\cos (x) + C$ if $x$ doesn't depend on $y$. In that case, $\frac{dx}{dy} = 0$.2017-01-09
  • 0
    Again, $cos(x)$ acts as a constant w.r.t $y$ and is therefore a constant factor to put before the differentiation.2017-01-09
  • 0
    if y was a function of x then the answer would have been different.2017-01-09

4 Answers 4

0

try differentiating this instead: $$\int \operatorname d (y \cos x) \operatorname dx + y \sin x\operatorname dx $$

where $y=f(x)$ and not just a constant

4

The derivative of $y\cos x$ wrt $y$ is $\cos x$ as you have, but the derivative of $C$ is $0$. Think about it, what is the slope of a constant function?

Now, if you apply product rule, and $x$ is independent of $y$, then we also have

$$\frac{dx}{dy}=0$$

If not, then your derivative is right, but your integral is wrong.

2

If $x$ and $y$ are independent, the differential form $\cos(x) \mathrm{d}y$ is not an exact form; this means it does not have an antiderivative.

For comparison, the form $\cos(x) \mathrm{d}y - y \sin(x) \mathrm{d}x$ is exact, and one of its antiderivatives is $y \cos(x)$. And note that $$ \mathrm{d}\left( y \cos(x) \right) = \cos(x) \mathrm{d}y - y \sin(x) \mathrm{d}x $$ will remain true even if $x$ and $y$ are not independent.


However, $\cos(x) \mathrm{d}y$ it can have an antiderivative if we force a dependence. The most pertinent is:

If $x$ is held constant, then $\cos(x) \mathrm{d}y$ has antiderivatives $y \cos(x) + g(x)$, where $g$ is any function of $x$.

It's the antiderivative because, if $x$ is held constant, then $\cos(x)$ and $g(x)$ are also constant and their derivatives are zero.

Typically, if $x$ and $y$ are independent variables that you are expressing things in terms of, then this is what is intended by the expression $\int \cos(x) \, \mathrm{d}y$; this is partial antidifferentiation, and is the inverse of the partial derivative with respect to $y$. (both meant as $x$ held constant)

0

Just like integration, when you differentiate a multivariable expression you must treat the other variables as constants. So when we take the derivative of $y\cos(x)$ with respect to $y$, think about how you would take the derivative of, for example, $y\cos(2)$. Since $\cos(2)$ is just a constant, it's just a coefficient; the derivative would be just $\cos(2)$. Likewise, $\cos(x)$ is a constant as far as $y$ is concerned, so it's just a coefficient; the derivative of $y\cos(x)$ is just $\cos(x)$.