# Sin function with complex number

**URL:** <https://community.wolfram.com/t/sin-function-with-complex-number/16053>\
**Category:** Questions\
**Tags:** algebra\
**Created:** [May 22, 2020, 1:05pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053 "2020-05-22T13:05:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin20001118](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kevin20001118](https://community.wolfram.com/u/kevin20001118)\
**Post date:** [May 22, 2020, 1:05pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/1 "2020-05-22T13:05:37Z")

</div>

As you can see in the picture, I want to know the complex solution Z when Sin(Z)=2, and the answer is shown in the picture, however, I can’t figure it out how can I get the right answer with Mathematica,can someone help me? Thanks.

 ![4470擷取2.PNG](https://global.discourse-cdn.com/wolfram/original/3X/d/a/da945d21fdd69aee56513b0dc7a32e191d39e192.png)

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [May 22, 2020, 1:23pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/2 "2020-05-22T13:23:13Z")

</div>

The equation has infinitely many solution. What do you expect as “the right answer”? Do you need to isolate two of the solutions? Here is a couple of ways:

```
Solve[Sin[z] == 2, z] /. C[1] -> 0
Solve[Sin[z] == 2 && Abs[z] < 3, z]

```

---

<div class="post-metadata">

**Author:** ![kevin20001118](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kevin20001118](https://community.wolfram.com/u/kevin20001118)\
**Post date:** [May 22, 2020, 1:23pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/3 "2020-05-22T13:23:55Z")

</div>

Sin function with complex number.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [May 22, 2020, 1:25pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/4 "2020-05-22T13:25:56Z")

</div>

Ok, here is a way:

```
Solve[Sin[z] == 2 && Abs[z] < 3, z] // ComplexExpand

```

---

<div class="post-metadata">

**Author:** ![kevin20001118](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kevin20001118](https://community.wolfram.com/u/kevin20001118)\
**Post date:** [May 22, 2020, 1:40pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/5 "2020-05-22T13:40:55Z")

</div>

Oh thank you, I have 2 more question:1.whats the different of using Complexes and ComplexExpand?2.what does [/. C[1] → 0] means or does? thanks again.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [May 22, 2020, 1:48pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/6 "2020-05-22T13:48:43Z")

</div>

`Complexes` is the set of the complex numbers. When used inside `Solve` it means that you seek complex solutions. Usually it is the default, and you don’t need ti specify it.

`ComplexExpand` is a command to try and rewrite complex numbers into separate real and imaginary parts. For example

```
In[15]:= ComplexExpand[Exp[Pi I/3]]

Out[15]= 1/2 + (I Sqrt[3])/2

```

Finally, `/. C[1] -> 0` is a replacement rule to replace all occurrences of `C[1]` with 0.

---

<div class="post-metadata">

**Author:** ![kevin20001118](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kevin20001118](https://community.wolfram.com/u/kevin20001118)\
**Post date:** [May 22, 2020, 1:57pm UTC](https://community.wolfram.com/t/sin-function-with-complex-number/16053/7 "2020-05-22T13:57:25Z")

</div>

Thanks, you really help a lot 🙂
