The number of cows is given by

So, after
years, the number of cows will be

We want this number to be twice as much as the original:

First of all, we can cancel 14 from both sides:

Finally, on the right hand side, we can use the exponent rule

to get

To solve this equation, we must impose that the two exponents are the same:

And clearly this is true if and only if
. So, it will take 5 years for the cow heard to double in number.
You can do the exact same steps to find the doubling time for the sheeps.