# I Solving for constants in a differential equation

1. Dec 14, 2017

### Tio Barnabe

I feel so sorry when I found myself trapped in a basic problem like this one, but let's go ahead...

Suppose we have the following equation, knowing that $B$ is a constant, $$\frac{dU( \theta)}{d \theta} + 2Br = 0$$ where we want to solve for $B$. If we differentiate the above equation with respect to $r$ we get that $B = 0$. But if we don't, we find $$B = -\frac{1}{2r} \frac{dU( \theta)}{d \theta}$$ That is, two seemgly valid but contradicting results. What am I missing here?

2. Dec 14, 2017

### Staff: Mentor

You treat $B$ simultaneously as a constant (first case) and as a function of $r$ (second case).

If $B=B(r)$ then differentiation gets you $B'r+B=0$ for the first equation, and $B'=\dfrac{1}{2r^2} \dfrac{dU(\theta)}{d\theta}=-\dfrac{B}{r}$ for the second, which are equal.

If $B$ is a constant, then differentiation gives $B=0$ and thus $\dfrac{dU(\theta)}{d\theta} =0$ and the second equation is also true: $0=0$.

3. Dec 14, 2017

### Tio Barnabe

Thanks!

4. Dec 17, 2017

### Staff: Mentor

As written, it doesn't make much sense to treat r as a variable. The differential equation indicates that U is a dependent variable, and $\theta$ is the independent variable.