# Indefinite Integral - II

## Homework Statement

$$\int \left(\frac{x}{x\cos x-\sin x} \right)^2 dx$$

## The Attempt at a Solution

Factoring out ##\cos x## from the denominator, the integral transforms to
$$\int \sec^2x \left(\frac{x}{x-\tan x}\right)^2dx$$
Substituting ##\tan x=t##, ##\sec^2 xdx=dt##
$$\int \left(\frac{\arctan t}{\arctan t-t}\right)^2dt$$
I honestly have no idea about how to proceed from here.

Any help is appreciated. Thanks!

Related Calculus and Beyond Homework Help News on Phys.org
SteamKing
Staff Emeritus
Homework Helper
I don't think you can factor cos x from sin x and obtain tan x. I suggest you expand the terms within the brackets and see if it can be simplified with trig identities.

Why can't I factor out cosx?
sinx/cosx=tanx

SteamKing
Staff Emeritus
Homework Helper
The problem is you have only sin x in your integral.

haruspex
Homework Helper
Gold Member
Look at the derivative of x cos(x) - sin(x). This suggests a way to use integration by parts.

Look at the derivative of x cos(x) - sin(x). This suggests a way to use integration by parts.
The derivative of xcos(x)-sin(x) is -xsin(x) but I still can't figure it out. The whole thing is squared, I am completely lost.

SteamKing
Staff Emeritus
Homework Helper
You could have expanded the brackets by now and checked to see if trig identities could further simplify the integrand.

haruspex
Homework Helper
Gold Member
The derivative of xcos(x)-sin(x) is -xsin(x) but I still can't figure it out. The whole thing is squared, I am completely lost.
It suggested to me writing the integrand as ##\frac{x}{\sin x} \frac{x\sin x}{\left(x\cos x-\sin x \right)^2} ##. Try integrating that by parts.

It suggested to me writing the integrand as ##\frac{x}{\sin x} \frac{x\sin x}{\left(x\cos x-\sin x \right)^2} ##. Try integrating that by parts.
Integrating by parts:
$$\frac{x}{\sin x} \int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx-\int \frac{\sin x-x\cos x}{\sin^2 x} \left(\int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx \right)dx$$

$$\because \int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx=(x\cos x-\sin x)$$
The integral simplifies to:
$$\frac{x}{\sin x}(x\cos x-\sin x)+\int \left(\frac{x \cos x-\sin x}{\sin x} \right)^2dx$$
If I expand the squared term, I get an integral involving cot and cot^2, should I integrate by parts again?

haruspex
Homework Helper
Gold Member
$$\because \int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx=(x\cos x-\sin x)$$
Retry that step.

SammyS
Staff Emeritus
Homework Helper
Gold Member
Integrating by parts:
$$\frac{x}{\sin x} \int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx-\int \frac{\sin x-x\cos x}{\sin^2 x} \left(\int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx \right)dx$$

$$\because \int \frac{x\sin x}{\left(x\cos x-\sin x \right)^2}dx=(x\cos x-\sin x)$$
The integral simplifies to:
$$\frac{x}{\sin x}(x\cos x-\sin x)+\int \left(\frac{x \cos x-\sin x}{\sin x} \right)^2dx$$
If I expand the squared term, I get an integral involving cot and cot^2, should I integrate by parts again?
[STRIKE]How is that integration by parts? What were the parts you used?[/STRIKE]

Try ##\displaystyle \ u=\frac{x}{\sin(x)}\ \text{ and }\ dv=\frac{x\sin(x)}{\left(x\cos(x)-\sin(x) \right)^2}\,dx \ . ##

Added in Edit: Part of the above edited out.
I see it now .

Last edited:
haruspex
Homework Helper
Gold Member
How is that integration by parts? What were the parts you used?

Try ##\displaystyle \ u=\frac{x}{\sin(x)}\ \text{ and }\ dv=\frac{x\sin(x)}{\left(x\cos(x)-\sin(x) \right)^2}\,dx \ . ##
Looks to me that Pranav-Arora was getting there - just made a mistake in the first integration.

SammyS
Staff Emeritus
Homework Helper
Gold Member
Looks to me that Pranav-Arora was getting there - just made a mistake in the first integration.
Oh ! I see it now.

I had looked at it several times and didn't see how that fit integration by parts.

Retry that step.
Oops, its the reciprocal of that.

This time I get:
$$\frac{x}{\sin x}\frac{1}{x\cos x-\sin x}+\int \csc^2 xdx=\frac{x}{\sin x}\frac{1}{x\cos x-\sin x}-\cot x$$

But on further simplification, I do not end up with the right answer.

ehild
Homework Helper
It is correct, bring to common denominator and simplify with sinx.Show what you did.

ehild

It is correct, bring to common denominator and simplify with sinx.Show what you did.

ehild
Got it, thanks!

Writing cot in terms cos and sin
$$\frac{x-x\cos^2 x+\cos x \sin x}{\sin x(x\cos x-\sin x)}=\frac{x(1-\cos^2 x)+\cos x \sin x}{\sin x(x\cos x-\sin x)}$$
As 1-cos^2x=sin^2x
$$\frac{x\sin^2 x+\cos x \sin x}{\sin x(x\cos x-\sin x)}=\frac{x\sin x+\cos x }{x\cos x-\sin x}$$

Thanks a lot haruspex!

Last edited: