If $f (x) +f'(x) = x^3+5x^2+x+2$ then find $f (x)$

If you're looking for all solutions, you can solve this as a linear differential equation of the first order which will be the sum of the homogeneous solution (an exponential function) and a particular solution, which will be a polynomial of degree 3.

$f(x) = C e^{-x} + x^3 + 2 x^2 - 3 x + 5$

If you're doing this outside of the context of differential equations and you're looking for a (single) solution, it makes sense to look for a polynomial of degree 3 since the derivative of a polynomial is again a polynomial, but of one degree less.

So say $f(x) = ax^3+bx^2+cx+d$, find $f'(x)$ and plug it in, solve for $a,b,c,d$:

$$ \left( ax^3+bx^2+cx+d \right) + \left( ax^3+bx^2+cx+d \right)' = x^3+5x^2+x+2 \iff \ldots$$

$f(x) = x^3 + 2 x^2 - 3 x + 5$


If $f(x)$ has degree $n $ then $ f'(x) $ has $n-1$ . Here highest degree is $3$ thus $ f (x) $ is a polynomial of degree $3$. Thus let $f (x)=ax^3+bx^2+cx+d $ thus we have $f (x)+f'(x)=ax^3+bx^2+cx+d+3ax^2+2bx+c $ Now comparing we have $ a=1,3a+b=5,c+2b=1,d+c=2$ thus $ f(x)=x^3+2x^2-3x+5.$


The hard way:

You can use the fact that $$(e^xf(x))'=e^x(f(x)+f'(x)).$$

Then

$$(e^xf(x))'=e^x(x^3+5x^2+x+2).$$

Now, by integration (which can be performed by parts, integrating $e^x$),

$$e^xf(x)=\int e^x(x^3+5x^2+x+2)dx=e^x(x^3+2x^2-3x+5)+C$$ and

$$f(x)=x^3+2x^2-3x+5+Ce^{-x}.$$

[I doubt this is the method you are expected to use...]


Empirically:

Let us assume that the solution is close to $f_0(x)=x^3$ and let us plug in the given equation.

$$f_0(x)+f'_0(x)=x^3+3x^2\ne x^3+5x^2+x+2.$$ But we are off by the polynomial $$2x^2+x+2$$ which is of a lower degree.

So let us try $f_1(x)=x^3+2x^2$, giving

$$f_1(x)+f'_1(x)=x^3+5x^3+4x\ne x^3+5x^2+x+2.$$

This time, we are only off by $-3x+2$, one degree less.

$$f_2(x)=x^3+2x^2-3x$$ then $$f_2(x)+f'_2(x)=x^3+5x^2+x-3.$$

And finally

$$f_3(x)=x^3+2x^2-3x+5$$ has converged to a solution.


Epilogue:

Let us assume that there exists another solution $f$ which is different from $f_3$.

From

$$f(x)+f'(x)=f_3(x)+f'_3(x)= x^3+5x^2+x+2,$$ we can draw that

$$f(x)-f_3(x)+f'(x)-f'_3(x)=0$$ which is of the form

$$g(x)+g'(x)=0.$$

It is not difficult to show that no polynomial is the opposite of its derivative. Actually, there is a single differentiable function having this property: the negative exponential

$$g(x)=e^{-x}$$ (or multiples).

Grouping these results,

$$f(x)=x^3+5x^2+x+2+Ce^{-x}.$$

Tags:

Calculus