Step 1: Rewrite \(g(x)\) with the same denominator.
Given,
\[
g(x)=\int \frac{2\,dx}{e^{3x}+8e^x+4e^{-x}}
\]
Multiplying numerator and denominator by \(e^x\), we get
\[
g(x)=\int \frac{2e^x}{e^{4x}+8e^{2x}+4}\,dx
\]
Also,
\[
f(x)=\int \frac{e^{3x}}{e^{4x}+8e^{2x}+4}\,dx
\]
Step 2: Find \(f(x)-g(x)\).
\[
f(x)-g(x)
=
\int \frac{e^{3x}-2e^x}{e^{4x}+8e^{2x}+4}\,dx
\]
\[
=
\int \frac{e^x(e^{2x}-2)}{e^{4x}+8e^{2x}+4}\,dx
\]
Step 3: Identify a suitable substitution.
Let
\[
u=\frac{e^x+2e^{-x}}{2}
\]
Then,
\[
\frac{du}{dx}
=
\frac{e^x-2e^{-x}}{2}
\]
Also,
\[
1+u^2
=
1+\left(\frac{e^x+2e^{-x}}{2}\right)^2
\]
\[
=
\frac{e^{2x}+8+4e^{-2x}}{4}
\]
Now,
\[
\frac{1}{2}\cdot \frac{u'}{1+u^2}
=
\frac{e^{3x}-2e^x}{e^{4x}+8e^{2x}+4}
\]
Step 4: Integrate.
Therefore,
\[
f(x)-g(x)
=
\frac{1}{2}\tan^{-1}u+C
\]
Substitute
\[
u=\frac{e^x+2e^{-x}}{2}
\]
Thus,
\[
f(x)-g(x)
=
\frac{1}{2}\tan^{-1}\left(\frac{e^x+2e^{-x}}{2}\right)+C
\]
Step 5: Final conclusion.
Hence,
\[
\boxed{
\frac{1}{2}\tan^{-1}\left(\frac{e^x+2e^{-x}}{2}\right)+C
}
\]