Evaluate the integral $\int_{0}^{\frac{\pi}{3}}\sin(x)\ln(\cos(x))\,dx$

$$\int_0^{\frac{\pi}{3}}\sin(x)\ln(\cos(x))\,dx$$

\begin{align} u &= \ln(\cos(x)) & dv &= \sin(x)\,dx \\ du &= \frac{-\sin(x)}{\cos(x)}\,dx & v &= -\cos(x) \end{align}

\begin{align} \int_0^{\frac{\pi}{3}}\sin(x)\ln(\cos(x))\,dx &= -\cos(x)\ln(\cos(x)) - \int \frac{-\cos(x)-\sin(x)}{\cos(x)}\,dx \\\\ &= -\cos(x)\ln(\cos(x)) - \int \sin(x)\,dx \\\\ &= -\cos(x)\ln(\cos(x)) + \cos(x) \\\\ F(g) &= -\cos(\pi/3)\ln(\cos(\pi/3)) + \cos(\pi/3) + \cos(0)\ln(\cos(0)) - \cos(0) \\\\ &= -\frac{1}{2}\ln\left(\frac{1}{2}\right) - \frac{1}{2} \\\\ \end{align}

However, my textbook says that the answer is actually $$\frac{1}{2}\ln(2) - \frac{1}{2}$$

Where does the $$\ln(2)$$ come from in the answer?

• Hint: $\ln(x^a) = a \ln(x)$ – Ajay Kumar Nair Feb 25 at 17:43
• It's perfect! Just notice now that $\ln \frac12 = \ln 1 - \ln 2 =-\ln 2$. – Zacky Feb 25 at 17:50
• @Zacky oh that makes sense. And that is where the (-) sign went as well! – Evan Kim Feb 25 at 18:33
• I'll also note that there is a simpler way: with a substitution $u = \cos x$ and $du = -\sin x$ this integral becomes $\int_{1/2}^1 \ln u\, du$. (Finding the antiderivative of $\ln$, if you don't already know it, also requires integration by parts, but it's very simple.) – Connor Harris Feb 25 at 19:59
• I will try to solve the problem this way and see what happens – Evan Kim Feb 25 at 20:27

Perhaps an easier method: $$I=\int_0^{\pi/3}\sin(x)\ln(\cos x)dx=-\int_0^{\pi/3}-\sin(x)\ln(\cos x)dx$$ Sub: $$u=\cos x\Rightarrow du=-\sin(x)dx$$ which gives $$I=\int_{1/2}^1\ln u\ du$$ Since $$\int\ln x\,dx=x(\ln x-1)=x\ln\frac{x}e$$ We have $$I=\ln\frac1e-\frac12\ln\frac1{2e}$$ Then using $$\ln(x^a)=\ln(e^{a\ln x})=a\ln x$$ We have $$I=-1+\frac12\ln2e=-1+\frac12\ln2+\frac12=\frac12\ln2-\frac12$$

Well, we have:

$$\mathcal{I}_\text{n}:=\int_0^\text{n}\sin\left(x\right)\cdot\ln\left(\cos\left(x\right)\right)\space\text{d}x\tag1$$

Substitute $$\text{u}:=\cos\left(x\right)$$ so we get:

$$\mathcal{I}_\text{n}=-\int_1^{\cos\left(\text{n}\right)}\ln\left(\text{u}\right)\space\text{d}\text{u}\tag2$$

Using IBP, we get:

$$\mathcal{I}_\text{n}=\left[-\text{u}\cdot\ln\left(\text{u}\right)\right]_1^{\cos\left(\text{n}\right)}+\int_1^{\cos\left(\text{n}\right)}1\space\text{d}x=\left[-\text{u}\cdot\ln\left(\text{u}\right)\right]_1^{\cos\left(\text{n}\right)}+\left[\text{u}\right]_1^{\cos\left(\text{n}\right)}=$$ $$-\cos\left(\text{n}\right)\cdot\ln\left(\cos\left(\text{n}\right)\right)+1\cdot\ln\left(1\right)+\cos\left(\text{n}\right)-1=\cos\left(\text{n}\right)\cdot\left(1-\ln\left(\cos\left(\text{n}\right)\right)\right)-1\tag3$$

So, when $$\text{n}=\frac{\pi}{2}$$ we get:

$$\mathcal{I}_{\frac{\pi}{3}}:=\int_0^\frac{\pi}{2}\sin\left(x\right)\cdot\ln\left(\cos\left(x\right)\right)\space\text{d}x=\cos\left(\frac{\pi}{3}\right)\cdot\left(1-\ln\left(\cos\left(\frac{\pi}{3}\right)\right)\right)-1=\frac{\ln\left(2\right)-1}{2}\tag4$$

$$-\ln(\frac{1}{2}) = \ln(2)$$ $$\ln(x^a) = a \ln(x)$$
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 21, "wp-katex-eq": 0, "align": 2, "equation": 0, "x-ck12": 0, "texerror": 0}