{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/5948","repository_url":"https://api.github.com/repos/sympy/sympy","labels_url":"https://api.github.com/repos/sympy/sympy/issues/5948/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/5948/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/5948/events","html_url":"https://github.com/sympy/sympy/issues/5948","id":28951610,"number":5948,"title":"integration of cos(x)/sin(x)**n","user":{"login":"sympy-issue-migrator","id":6188475,"avatar_url":"https://avatars.githubusercontent.com/u/6188475?v=3","gravatar_id":"","url":"https://api.github.com/users/sympy-issue-migrator","html_url":"https://github.com/sympy-issue-migrator","followers_url":"https://api.github.com/users/sympy-issue-migrator/followers","following_url":"https://api.github.com/users/sympy-issue-migrator/following{/other_user}","gists_url":"https://api.github.com/users/sympy-issue-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy-issue-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy-issue-migrator/subscriptions","organizations_url":"https://api.github.com/users/sympy-issue-migrator/orgs","repos_url":"https://api.github.com/users/sympy-issue-migrator/repos","events_url":"https://api.github.com/users/sympy-issue-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/sympy-issue-migrator/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sympy/sympy/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/sympy/sympy/labels/imported","name":"imported","color":"ededed"},{"url":"https://api.github.com/repos/sympy/sympy/labels/integrals","name":"integrals","color":"0000FF"},{"url":"https://api.github.com/repos/sympy/sympy/labels/valid","name":"valid","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2011-11-17T07:20:49Z","updated_at":"2016-05-20T14:05:54Z","closed_at":null,"body":"```\r\nThe result of integrate(cos(x)/sin(x)**n, x) is\r\n\"nice\", if n is even, and \"ugly\", if n is odd\r\n(n is an integer, greater than 1).\r\n\r\nMoreover, if n is odd, then diff(integrate(cos(x)/sin(x)**n, x), x)\r\ngives a very ugly expression that cannot be converted back to\r\ncos(x)/sin(x)**n by simplify.\r\n\r\nExample:\r\nIn [136]: diff(integrate(cos(x)/sin(x)**7, x), x)\r\n             5                   3                      \r\n36⋅sin(x)⋅cos (x) - 72⋅sin(x)⋅cos (x) + 36⋅sin(x)⋅cos(x)\r\n────────────────────────────────────────────────────────\r\n                                                2       \r\n       ⎛     6            4            2       ⎞        \r\n       ⎝6⋅cos (x) - 18⋅cos (x) + 18⋅cos (x) - 6⎠        \r\n\r\nGabor Takacs\r\n```\r\nOriginal issue for #5948: http://code.google.com/p/sympy/issues/detail?id=2849\r\nOriginal author: https://code.google.com/u/114262867030455207545/\r\n"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/220614814","html_url":"https://github.com/sympy/sympy/issues/5948#issuecomment-220614814","issue_url":"https://api.github.com/repos/sympy/sympy/issues/5948","id":220614814,"user":{"login":"oldk1331","id":14226565,"avatar_url":"https://avatars.githubusercontent.com/u/14226565?v=3","gravatar_id":"","url":"https://api.github.com/users/oldk1331","html_url":"https://github.com/oldk1331","followers_url":"https://api.github.com/users/oldk1331/followers","following_url":"https://api.github.com/users/oldk1331/following{/other_user}","gists_url":"https://api.github.com/users/oldk1331/gists{/gist_id}","starred_url":"https://api.github.com/users/oldk1331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldk1331/subscriptions","organizations_url":"https://api.github.com/users/oldk1331/orgs","repos_url":"https://api.github.com/users/oldk1331/repos","events_url":"https://api.github.com/users/oldk1331/events{/privacy}","received_events_url":"https://api.github.com/users/oldk1331/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T14:05:54Z","updated_at":"2016-05-20T14:05:54Z","body":"With sympy 1.0, here is what I get:\r\n````\r\nIn [8]: integrate(cos(x)/sin(x)**n, x)\r\nOut[8]: \r\n⎧    log(sin(x))      for n = 1\r\n⎪                              \r\n⎪      -sin(x)                 \r\n⎨───────────────────  otherwise\r\n⎪     n         n              \r\n⎪n⋅sin (x) - sin (x)           \r\n⎩                              \r\n\r\nIn [10]: diff(integrate(cos(x)/sin(x)**7, x), x)\r\nOut[10]: \r\n             5                   3                      \r\n36⋅sin(x)⋅cos (x) - 72⋅sin(x)⋅cos (x) + 36⋅sin(x)⋅cos(x)\r\n────────────────────────────────────────────────────────\r\n                                                2       \r\n       ⎛     6            4            2       ⎞        \r\n       ⎝6⋅cos (x) - 18⋅cos (x) + 18⋅cos (x) - 6⎠        \r\n\r\nIn [11]: simplify(diff(integrate(cos(x)/sin(x)**7, x), x))\r\nOut[11]: \r\n cos(x)\r\n───────\r\n   7   \r\nsin (x)\r\n````\r\n\r\nI think that's good enough to close this issue."}}
{"actor":{"display_login":"oldk1331"}}