# I Solving for constants in a differential equation

#### 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?

Related Differential Equations News on Phys.org

#### fresh_42

Mentor
2018 Award
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$.

Thanks!

#### Mark44

Mentor
Suppose we have the following equation, knowing that $B$ is a constant, $\frac{dU( \theta)}{d \theta} + 2Br = 0$
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.

### Want to reply to this thread?

"Solving for constants in a differential equation"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving