Question: $\int\_d^{d+T} cos(nwt)dt = 0$ for $n ≠ 0$

where $w$ is the circular frequency. 

I tried proving this using an arbitrary value of n, ie n = 1. But I get:

$\frac{1}{w}[sin(\frac{\pi d}{T})(cos(1)-1)+ sin(1)cos(\frac{\pi d}{T})]$

Which does not look promising. 

Anyone know how to do this? Any help is greatly appreciated!
Kind Regards,

Answer: 
(NOTE: depending on your turing machine model, "accept" and "reject" may be considered their own state. If we do this, then the problem is decidable and trivial, so I will assumine these are special states that are not under consideration of the problem)

The typical solution for these kind of problems is to construct a TM $T\_1$ that will simulate an arbitrary turing machine $T\_2$ until it halts, where your property $P$ holds iff $T\_2$ does end up halting, thus if we can decide $P$ we can decide halting for arbitrary TM $T\_2$.

In these case, we will use the property "visits every state more than $K$ times".

It's easy to ensure that this property does not hold if $T\_2$ never halts, just add some state "T\_2\_HALTED" that we visit after $T\_2$ halts. We are simulating $T\_2$ until it halts, so we never reach this state if $T\_2$ never halts.

Now, we just need to ensure this property *does* hold for any $T\_2$ that halts. In other words, we need some way to visit every state in our turing machine $K+1$ times.

(for simplicity I am going to assume that a TM model that can transition without moving the tape head left or right)

After we visit the "T\_2\_HALTED" state we need to visit every other state $K+1$ times. We do this by first placing an extra $K+1$ letters in our TM alphabet, $\alpha\_0 ... \alpha\_k$. 

Then add to our transitions for every state other than "T\_2\_HALTED" that if it sees $\alpha\_i$ on the tape for $i < k$, it will transition state to itself and write $\alpha\_{i+1}$ on the tape without moving the tape head. If it sees $\alpha{k}$ on the tape, it will transition to another state according to some arbitrary total ordering on the state and write $\alpha\_0$ on the tape (but make sure "T\_2\_HALTED" is the last state on this ordering).

Finally, the rule for "T\_2\_HALTED" is that if the value on the tape is not any $\alpha\_i$, then it will transition to the first state in the ordering and write $\alpha\_0$ on the tape, and if $\alpha\_0$ to $\alpha\_{k-1}$ is on the tape it will increment and transition to itself (like every other state), and if $\alpha\_k$ is on the tape, $T\_1$ halts.

So, the total effect is that by adding characters in our alphabet we can put a "side-algorithm" that lets us visit every state $K$ times, and we do this once $T\_2$ halts. Since these are 'extra characters', we are assuming that these will never be written during our simulation of $T\_2$, so we will never trigger this loop accidentally. Therefor, we visit every state $K$ times if and only if $T\_2$ halts.
Suppose you can do that. Take a machine you want to solve halting problem for, replace 'halt' with going to additional `halt` state and at the beginning cycle through all other states. Run your hypothetical check for this altered machine and $K=0$ and you've solved the halting problem (`true` means we won't reach `halt` state since we've visited all other states once in the beginning, `false` means we will get to `halt` which only happens in the end).