The integral is:$$\int\sqrt{1+\sin x} dx$$  My first attempt was to multiply by:  $$\frac{\sqrt{1-\sin x}}{\sqrt{1-\sin x}}$$  giving: $$\int\frac{\sqrt{1-\sin^2(x)}}{\sqrt{1-\sin x}}dx$$ which is: $$\int\frac{\cos x}{\sqrt{1-\sin x}}dx$$ then make the substitution: $$u=1-\sin x$$ which gives $$\int\frac{-1}{\sqrt{u}}du$$ which gives: $$-2\sqrt{u}+c$$ so: $$I=-2\sqrt{1-\sin x}+c$$ but I am not sure if this is correct.  Also sorry if the formatting is a bit rubbish
To find:  $$\int \sqrt{1+\sin(x)} dx$$  What I  tried:  I put $\tan(\frac{x}{2}) = t$, using which I got it to:  $$I = 2\int \dfrac{1+t}{(1+t^2)^{\frac{3}{2}}}dt$$  Now I am badly stuck. There seems no way to approach this one. Please give a hint. Also, can we initially to some manipulations on the original integral to make it easy? Thank you.
I want to reinstall Ubuntu from scratch.   I have read ( and ) that it is recommended to have 3 partitions for the desktop installation: root, home and swap as having a separate home and root can simplify the process if you want to upgrade or reinstall Ubuntu (if you break something by mistake).  But there is no type of formula (that I can find) on how big each partition should be. I know this is somewhat dependant on what you plan to install. I want to have flexibility down the line to install new software without having to worry about shifting the partition sizes around.  Does anyone know of a formula or percentage breakdown that they have used to successfully calculate partition sizes?  i.e. x% of space will be allocated to the swap, y% of space to the root partition and z% of space to the home partition In the following method definitions, what does the * and ** do for param2?  def foo(param1, *param2): def bar(param1, **param2): Is there some rare language construct I haven't encountered (like the few I've learned recently, some on Stack Overflow) in C# to get a value representing the current iteration of a foreach loop?  For instance, I currently do something like this depending on the circumstances:  int i = 0; foreach (Object o in collection) {     // ...     i++; } Is it possible to paginate posts correctly that are random ordered? I found this problem on Wordpress Support and the topic unfortunately is now closed.  I have this same issue... (read below)    We have created a site where members can recommend things like favourite books, movie, songs, etc. For this problem I will use the Movies page as an example.  The "Movies" page is ultimately a custom page template that asks wordpress to display a random list of ALL posts that have been given the category "movies" (category 31). It displays the title of these movies in random order using the code below.  &lt;?php  $rand = new WP_Query("cat=31&amp;showposts=-1&amp;orderby=rand");  while($rand-&gt;have_posts()) : $rand-&gt;the_post(); ?&gt;" rel="bookmark" title="Permanent Link to &lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt; &lt;?php endwhile; ?&gt;   Problem is the list is getting rather long and I would like to split it up into two or more pages of about 10 movies each. To achieve this, I have used the code below.  &lt;?php  $page = (get_query_var('paged')) ? get_query_var('paged') : 1;  query_posts("cat=31&amp;orderby=rand&amp;showposts=10&amp;paged=$page");  while ( have_posts() ) : the_post()  ?&gt;" rel="bookmark" title="Permanent Link to &lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt; &lt;?php endwhile; ?&gt;   But there is a problem because although it splits up the data into pages of 10 posts each (paginates), it fails to include a new set of 10 posts on page 2 and so forth. In other words, because it is listing things in a random order, it just goes out and gets another 10 random posts (or in this case movie titles). As a result, we have some repeated movie title posts instead of a new set of 10 random movie titles on page 2, etc.  My question is - what can I add to this code to get wordpress to "remember" which random 10 posts it included on page 1, and then have it get a new set of 10 posts to put on pages 2, 3, etc. until all posts are displayed. I would like there to be only one occurrence of a post per page when sorted randomly in sets of 10. When should a supervisor be an author? I understand that in a lot of big-lab fields it is common for the principal investigator to append their name to a paper even if they did not write the paper, design the experiment, or collect data since they spend energy securing funding, and managing the whole lab. What about for small labs?  What are the requirements for a supervisor to be included as an author on a paper, as opposed to just appearing in the acknowledgements? If you are working on your own projects independently of your supervisor, but using funding provided by your supervisor (how does this change when the funding provides resources versus just your salary), are you suppose to add them as authors or just acknowledge the source of funding? Finding net magnetic and electric force on charged particle This is from my textbook, it is not an assigned problem, but I want to understand.   It says:      Consider the situation in the figure, in which there is a uniform electric field in the x direction and a uniform magnetic field in the y direction. For each example of a proton at rest or moving in the x, y, or z direction, what is the direction of the net electric and magnetic force on the proton at this instant?   I believe I need to use the equation   $$ F_{net}=(q\overrightarrow{E})+q(\overrightarrow{v} \times \overrightarrow{B}) $$  But I'm not sure exactly how. We've just started to learn about this, and I want to get a head start. Could anyone put me on the right track? I'd never heard of anycast until a few seconds ago when I read "".  The wikipedia "" article on it is quite formal and doesn't really evoke a mental picture of how it would be used.  Can someone explain in a few informal sentences what "anycast" is, how you configure it (just in a general sense), and what its benefits are (what does it make easier)? How to fix byte array java.lang.NullPointerException I am trying to show that: \begin{equation} \frac{n}{\phi(n)} = \sum_{d \mid n} \frac{\mu^2(d)}{\phi(d)} \end{equation} where $\phi(n)$ is  and $\mu$ is the .  The identity clearly holds for $n=1$, so if we write $n=p_1^{a_1} \cdots p_k^{a_k}$ for the prime decomposition of $n$, the left-hand side becomes: \begin{eqnarray*} \frac{n}{\phi(n)} &amp; = &amp; \frac{p_1^{a_1} \cdots p_k^{a_k}}{\phi(p_1^{a_1}) \cdots \phi(p_k^{a_k})} \\ &amp; = &amp; \frac{p_1^{a_1} \cdots p_k^{a_k}}{(p_1^{a_1-1})(p_1-1) \cdots (p_k^{a_k})(p_k-1)} \\ &amp; = &amp; \frac{p_1 \cdots p_k}{(p_1-1)\cdots (p_k-1)} \end{eqnarray*}   Whereas the right-hand side becomes:  \begin{eqnarray*} \sum_{d \mid n} \frac{\mu^2(d)}{\phi(d)} &amp; = &amp; \sum_{\substack{d \mid n \\ p^2 \nmid d}} \frac{1}{\phi(d)} \\ &amp; = &amp; 1 + \frac{1}{\phi(p_1)} + \dots + \frac{1}{\phi(p_k)} + \frac{1}{\phi(p_1 p_2)} + \dots + \frac{1}{\phi(p_{k-1}p_k)} \\ &amp; + &amp; \dots + \frac{1}{\phi(p_1 \cdots p_k)} \\ &amp; = &amp; 1 + \frac{1}{p_1 - 1} + \dots + \frac{1}{p_k - 1} + \frac{1}{(p_1 - 1)(p_2 - 1)} + \dots + \frac{1}{(p_{k-1}-1)(p_k-1)} \\ &amp; + &amp; \dots + \frac{1}{(p_1 - 1) \cdots (p_k - 1)} \end{eqnarray*}  I am unsure of how to proceed from this point however. Any help would be much appreciated. Having Overfull and underfull box warnings. Please help out as there are many matrices and equations How do I create a list of Python lambdas (in a list comprehension/for loop)? I want to create a list of lambda objects from a list of constants in Python; for instance:  listOfNumbers = [1,2,3,4,5] square = lambda x: x * x listOfLambdas = [lambda: square(i) for i in listOfNumbers]   This will create a list of lambda objects, however, when I run them:  for f in listOfLambdas:     print f(),   I would expect that it would print  1 4 9 16 25   Instead, it prints:  25 25 25 25 25   It seems as though the lambdas have all been given the wrong parameter. Have I done something wrong, and is there a way to fix it? I'm in Python 2.4 I think.  EDIT: a bit more of trying things and such came up with this:  listOfLambdas = [] for num in listOfNumbers:     action = lambda: square(num)     listOfLambdas.append(action)     print action()   Prints the expected squares from 1 to 25, but then using the earlier print statement:  for f in listOfLambdas:     print f(),   still gives me all 25s. How did the existing lambda objects change between those two print calls?  Related question: Let $$S=\sum_{n=1}^{\infty}x^{n^2}, \quad|x|&lt;1.$$  It is convergent and the sum is definitely less than $1/(1-x).$   Is there any closed form for $S$ ? Remove Actions/Filters added via Anonymous Functions That's a freaking bad practice I must say. Spent last two hours finding a solution to remove actions and filters added via Anonymous functions.    This is the code used on a Parent Theme, and I need to remove it.  /**  * Add custom columns to admin comments grid  *  * Rate that user set.  */ add_filter( 'manage_edit-comments_columns', function( $default ) {     $columns['smr_comment_rate']  = __( 'Rate', 'txtdmn' );      return array_slice( $default, 0, 3, true ) + $columns + array_slice( $default, 2, NULL, true ); });   Got , played with it heavily, but no help. So, is there any other alternative that will remove actions/filters added via anonymous functions?  Thanks Where is attribute table in ArcGIS Desktop when not visible? I've just updated to ArcGIS 10.1 for Desktop and when I go to open an attribute table, I can not see it anywhere.   I'm wondering if it is off my screen somewhere or if its just super tiny that I can't see it.   I'm using dual monitors and it's not popping up on either.  Is there a way I can find my attribute table? When I've worked a bit with my source code, I did my usual thing commit and then I pushed to a remote repository. But then I noticed I forgot to organize my imports in the source code. So I do the amend command to replace the previous commit:  &gt; git commit --amend   Unfortunately the commit can't be pushed back to the repository. It is rejected like this:  &gt; git push origin To //my.remote.repo.com/stuff.git/  ! [rejected]        master -&gt; master (non-fast forward) error: failed to push some refs to '//my.remote.repo.com/stuff.git/'   What should I do? (I can access the remote repository.) How to resize array in C++? When should comments be flagged/deleted on per-site metas? We all know , but that guidance is, naturally, geared toward main sites, where we want to keep things clean and focused.  Meta, on the other hand, is a site's "second place", with some different rules and conventions.  For example, questions on main sites can be closed as primarily-opinion-based, but meta is all about opinions.  There's a "discussion" tag and such questions collect many opinions.  Meta is different.  Occasionally I see comment flags on metas and I'm never sure what to do with them.  Setting aside things that are blatantly offensive or spam (that's a no-brainer), is there such a thing as "too chatty" or a comment discussion that should be moved to chat on meta?  I am very conservative in deleting things on per-site metas (except on  posts, which like main should stay focused).  Are there any guidelines specific to per-site metas?  I'm specifying per-site metas and not MSE because MSE seems to have conventions that fall somewhere between "main site" and "per-site meta".  If the answer is the same for all metas then great, but I don't want to assume it'll be the same. How do I get the difference between two Dates in JavaScript? I'm creating an application which lets you define events with a time frame.  I want to automatically fill in the end date when the user selects or changes the start date.  I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference. I'm trying to make a command block that spawns an item in front of you if you are holding an item with a specific name. I've got these two working scripts;  /testfor @p[r=10] {Inventory:[{tag:{display:{Name:"Item Name"}}}]}  /testfor @p[r=10] {SelectedItemSlot:0,Inventory:[{Slot:0b,­id:"minecraft:diamond_sword"}]­}   but I can't get them together. The block should only look for an item in the active slot. I am stuck on the following problem that says:       a) Find a weak formulation for the partial differential equation $${\partial u\over\partial t\ }+ c{\partial u \over \partial x\ }=0$$    b) Show that $u=f(x-ct)$ is a generalized solution of $${\partial u\over\partial t\ }+ c{\partial u \over \partial x\ }=0$$ for any distribution $f$    My Attempt:   I know that in order to find a weak form of a pde, we need to multiply it by a test function, then integrate it. Also, to find a generalized solution, we need to find a weak solution and just multiply it by the Heaviside function.  Let's take any test function $\phi $, then we have (integrating by parts second part of the integral) $$\int_{\Omega } ( {\partial u\over\partial t\ }+ c{\partial u \over \partial x\ })*\phi(x) dx= \int_{\Omega } {\partial u\over \partial t}\phi(x) dx - c\int_{\Omega } u(x,t)\phi'(x)dx$$ where $\phi $ vanishes at boundaries. So, is it the final form or can we proceed further? And how am I supposed to find a generalized solution?  Can someone help me out? Thanks in advance for your time.