Answer: \(\ln(1+\mathrm e^x)=\ln 2+\frac12x+\frac18x^2\) up to and including the term in \(x^2\).
Let \(y=\ln(1+\mathrm e^x)\).
For a Maclaurin series, we need \(y(0)\), \(y'(0)\) and \(y''(0)\).
Differentiate:
\(y'=\frac{\mathrm e^x}{1+\mathrm e^x}\).
Differentiate again:
\(y''=\frac{\mathrm e^x(1+\mathrm e^x)-\mathrm e^x\cdot \mathrm e^x}{(1+\mathrm e^x)^2}=\frac{\mathrm e^x}{(1+\mathrm e^x)^2}\).
Now evaluate at \(x=0\):
- \(y(0)=\ln(1+\mathrm e^0)=\ln 2\)
- \(y'(0)=\frac{1}{2}\)
- \(y''(0)=\frac{1}{4}\)
Using the Maclaurin expansion,
\(y=y(0)+y'(0)x+\frac{1}{2!}y''(0)x^2+\cdots\).
So
\(\ln(1+\mathrm e^x)=\ln 2+\frac12x+\frac{1}{2}\cdot\frac14x^2+\cdots=\ln 2+\frac12x+\frac18x^2+\cdots\).
Hence, up to and including the term in \(x^2\),
\(\ln(1+\mathrm e^x)=\ln 2+\frac12x+\frac18x^2\).