# DSolve empty solution error?

**URL:** <https://community.wolfram.com/t/dsolve-empty-solution-error/19984>\
**Category:** Questions\
**Tags:** calculus, equation-solving\
**Created:** [April 29, 2022, 10:18pm UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984 "2022-04-29T22:18:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 29, 2022, 10:18pm UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/1 "2022-04-29T22:18:00Z")

</div>

I have tried the following and get an error I don’t understand. I am a bit of a newbie so I expect there is a simple explanation.

```
DSolve[{f'[t] == k f[t] - c, f[0] == D, f[T] == 0}, f[t], t]

```

I get  
DSolve::bvnul: For some branches of the general solution, the given boundary conditions lead to an empty solution.

I don’t understand this! please help!

Many thanks,

Steve

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [April 30, 2022, 12:07am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/2 "2022-04-30T00:07:41Z")

</div>

D is a Mathematica intrinsic symbol. You should avoid variable names with capital letters.  
I think

```
hh[t_] := (a (-E^(k t) + E^(k T)))/(-1 + E^(k T))

```

With D interchanged with a is what you are looking for.

```
hh[0]
hh[T]

```

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 12:23am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/3 "2022-04-30T00:23:32Z")

</div>

Many thanks

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 12:30am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/4 "2022-04-30T00:30:34Z")

</div>

I tried changing the variable names but that didn’t help.

```
DSolve[{f'[t] == k f[t] - c, f[0] == s, f[p] == 0}, f[t], t]

```

Maybe I didn’t understand your suggestion.

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 12:38am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/5 "2022-04-30T00:38:37Z")

</div>

Now I must also find out how to mark myself as retired! Because a I am also happily retired.

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [April 30, 2022, 12:40am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/6 "2022-04-30T00:40:19Z")

</div>

Well, DSolve doesn’t work on my system either, but hh given above solves the ODE and the other conditions.

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 12:56am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/7 "2022-04-30T00:56:34Z")

</div>

Don’t the E^(k t) terms cancel?

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 12:58am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/8 "2022-04-30T00:58:53Z")

</div>

Oh no, sorry.

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 1:19am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/9 "2022-04-30T01:19:03Z")

</div>

Your solution is missing the constant ‘c’

It does give the correct boundary values.

---

<div class="post-metadata">

**Author:** ![stephenmor](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@stephenmor](https://community.wolfram.com/u/stephenmor)\
**Post date:** [April 30, 2022, 1:27am UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/10 "2022-04-30T01:27:04Z")

</div>

In[32]:= hh[t\_] := (a (-E^(k t) + E^(k T)))/(-1 + E^(k T))

```
In[33]:= hh[0]

Out[33]= a

In[34]:= hh[T]

Out[34]= 0

In[35]:= hh'[t] - k hh[t]

Out[35]= -((a E^(k t) k)/(-1 + E^(k T))) - (
 a (-E^(k t) + E^(k T)) k)/(-1 + E^(k T))

```

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [April 30, 2022, 12:18pm UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/11 "2022-04-30T12:18:13Z")

</div>

Your In[35] is not the complete differential equation. And c is fixed by your conditions. Look at

```
hh'[t] - (k hh[t] - c) /. c -> (a E^(k T) k)/(-1 + E^(k T)) // FullSimplify

```

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [April 30, 2022, 12:57pm UTC](https://community.wolfram.com/t/dsolve-empty-solution-error/19984/12 "2022-04-30T12:57:17Z")

</div>

Here is the whole procedure

```
dgl = f'[t] == k f[t] - c
sol = f[t] /. DSolve[dgl, f[t], t][[1, 1]] /. C[1] -> u
ff[u_] := Evaluate[sol]
(*ff fulfills the diff equation*)
D[ff[u], t] - (k ff[u] - c) // Simplify
(*you have only one constant of integration, so c is not free but must be adapted*)
e1 = (ff[u] /. t -> 0) == d
e2 = (ff[u] /. t -> T) == 0
sol2 = Solve[{e1, e2}, {u, c}] // Flatten
gg = ff[u] /. sol2 // Simplify
gg /. t -> 0
gg /. t -> T
(* use the fixed c in the differential equation *)
D[gg, t] - (k gg - c) /. sol2 // Simplify

```
