Let y=(xcosx)x+(xsinx)1x
Also, let u=(xcosx)x and v=(xsinx)1x
∴y=u+v
⇒dydx=dudx+dvdx ...(1)
u=(xcosx)x
⇒logu=log(xcosx)x
⇒logu=xlog(xcosx)
⇒logu=x[logx+logcosx]
⇒logu=xlogx+xlogcosx
Differentiating both sides with respect to x, we obtain
1ududx=ddx(xlogx)+ddx(xlogcosx)
⇒dudx=u[(logx.ddx(x)+x.ddx(logx))+(logcosx.ddx(x)+x.ddx(logcosx))]
⇒dudx=(xcosx)x[(logx.1+x.1x)+(logcosx.1+x.1cosx.ddx(cosx))]
⇒dudx=(xcosx)x[(logx+1)+(logcosx+xcosx.(−sinx))]
⇒dudx=(xcosx)x[(1+logx)+(logcosx−xtanx)]
⇒dudx=(xcosx)x[1−xtanx+(logx+logcosx)]
⇒dudx=(xcosx)x[1−xtanx+log(xcosx)] ... (2)
v=(xsinx)1x
⇒logv=log(xsinx)1x
⇒logv=1xlog(xsinx)
⇒logv=1x(logx+logsinx)
⇒logv=1xlogx+1xlogsinx
Differentiating both sides with respect to x, we obtain
1vdvdx=ddx(1xlogx)+ddx[1xlog(sinx)]
⇒1vdvdx=[logx.ddx(1x)+1x.ddx(logx)]+[log(sinx).ddx(1x)+1x.ddx(log(sinx))]
⇒1vdvdx=[logx.(−1x2)+1x.1x]+[log(sinx).(−1x2)+1x.1sinx.ddx(sinx)]
⇒1vdvdx=1x2(1−logx)+[−log(sinx)x2+1xsinx.cosx]
⇒dvdx=(xsinx)1x[1−logxx2+−log(sinx)+xcotxx2]
⇒dvdx=(xsinx)1x[1−logx−log(sinx)+xcotxx2]
⇒dvdx=(xsinx)1x[1−log(xsinx)+xcotxx2] ...(3)
From (1), (2) and (3), we obtain
dydx=(xcosx)x[1−xtanx+log(xcosx)]+(xsinx)1x[xcotx+1−log(xsinx)x2]