## conversion of sin to cos

Mathematica

### Next

• 1. Convert funcion
Hello Group, Someone could help me with this function? fConver[cmatrix], this function will find all subsets of rows of the rectangular matrix which have exactly one nonzero element in each column. For example: cmatrix=({{0,0,1,0,1,1,0},{1,0,0,1,0,0,1},{0,1,1,0,0,1,0}, {1,0,0,1,0,0,0},{0,1,0,0,0,0,1},{0,0,0,1,1,0,1}}); fConvert[cmatrix] the out put will be {{{1,4},{3,5,6},{2,7}}} Thank you All, Johum,
I am preparing a graph for publication. I have been able to shade various areas in the graph different colors using the Filling option. However, for publication the paper will be in black and white. I would like to change the shaded areas to be filled in with crosshatches, parallel lines, etc. What are the options and commands to do this? I have looked online, but have not found an answer. Thanks in advance.
• 3. plot a function
If i want to draw a function y=sinx*e^x in x =0.5 to 1.5 [only in this interval ] How I can do that with mathematica?
• 4. Inverse of symbolic matrix
The expressions a and b below seem reasonable. However when I assemble them into a matrix and take the inverse I get the message Inverse::"sing" :Matrix...is singular. However the determinant seems fine. If I rationalize the matrix and then take its inverse then everything seems fine and I can almost get the unit matrix by multiplying back onto the original matrix. Is there a problem with approximate numbers in symbolic matrices? Is this a bug? Is Rationalize the best method for working around this problem? Thanks Hugh Goyder a = -((4.739*^-6 - 0.0008*I)/((0.0122 + 1.544*I) + s)) - (4.7395*^-6 + 0.00088*I)/ ((0.0122 - 1.544*I) + s); b = -((0.000015 - 0.00022*I)/((0.0122 + 1.544*I) + s)) - (0.000015 + 0.000226*I)/ ((0.0122 - 1.544*I) + s); mat = {{a, 0}, {0, b}}; Inverse[mat] Det[mat] matr = Rationalize[mat, 0]; inv = Inverse[matr] Rationalize[Factor[Together[mat . inv]], 1.*^-8]

### conversion of sin to cos

```Hello all,

Here is my problem. I have a very long product of cosines with
arguments of the form k*Pi, k being integers.
I want to convert this expression to a sum of cosines. TrigReduce
works fine, except that it converts cos to sin.
So, I want all the sin (after the TrigReduce) to be converted to cos
and the arguments be of the form p*Pi, p being rational of course.
It has something to do with Hold or HoldAll, but I don't know the
details. Or perhaps the TrigReduce can be overridden
somehow.
Can someone help?

```

### Re: conversion of sin to cos

```

Cos[J Pi] is + or - depending on whether J is respy even/odd . If
there are m odd Pis and n even Pis, then J = m  alone decides the
sign, - for odd m and + for even m. HTH

```

### Re: conversion of sin to cos

```

It might be helpful to give a small actual example of what you want to
achieve. As you have described it, I would have thought the answer would
reduce to +1 or -1.

David Bailey
http://www.**--****.com/

```

### Re: conversion of sin to cos

```

Hi Glenn,

Please, could you post an actual (short) example of such a product as
well as what you get having trigreduced it?

Meanwhile, Simplify/FullSimplify with the option ComplexityFunction
might be what you are looking for.

Regards,
--
Jean-Marc

```

### Re: conversion of sin to cos

```

Cos[k*Pi] == (-1)^k, so your expression is probably a bit more
complicated than that :-)

Have you tried

expression /. Sin[a_] :> Cos[a - Pi/2]

or

expression /. Sin[a_] :> Cos[Collect[a - Pi/2, Pi]]

or

expression /. Sin[a_] :> Cos[Collect[a - Pi/2, Pi, Together]]

?  It would be easier to answer if you posted a short sample of a
Sin-expression that you need converted to a Cos-expression.

Hold[] just prevents evaluation of its arguments.  HoldAll is not a
function, but an attribute.  It is the attribute that gives Hold[] its
magic.

```

### Re: conversion of sin to cos

```

Hi Glenn,

you don't need a CAS for this. I'll just use Mathematica syntax here:

For integer k: Cos[k*Pi]==(-1)^k.

If your product is Product[Cos[k[i]*Pi],{i,1,n}], then it can be written as
(-1)^Mod[Sum[k[i],{i,1,n}],2] or if you insist on cosines:
Cos[Mod[Sum[k[i],{i,1,n}],2]*Pi].

Peter

```

### Re: conversion of sin to cos

```
Hi,

you may simply replace all Sin[x] -> Cos[x-Pi/2]

hope this helps, Daniel

```